>From 1d170207e4ff99756412057d96099ab917a14d57 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 21 Sep 2015 11:56:01 -0700 Subject: [PATCH] Improve git diff hunk headers for .el, .texi Problem reported by Alan Mackenzie in: http://lists.gnu.org/archive/html/emacs-devel/2015-09/msg00826.html * .gitattributes (*.el, *.texi): New patterns. * autogen.sh: Configure diff.elisp.xfuncname and diff.texinfo.xfuncname if using Git. --- .gitattributes | 4 ++++ autogen.sh | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 21af4e6..ac26a2b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -44,3 +44,7 @@ doc/misc/texinfo.tex -whitespace=blank-at-eol *.sig binary *.tiff binary etc/e/eterm-color binary + +# Hooks for non-default diff hunk headers; see autogen.sh. +*.el diff=elisp +*.texi diff=texinfo diff --git a/autogen.sh b/autogen.sh index bc9c5a0..926915c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -216,8 +216,20 @@ autoreconf -fi -I m4 || exit $? ## cause 'make' to needlessly run 'autoheader'. echo timestamp > src/stamp-h.in || exit -## Install Git hooks, if using Git. -if test -d .git/hooks; then + +## Configure Git, if using Git. +if test -d .git; then + + # Configure 'git diff' hunk header format. + + git config 'diff.elisp.xfuncname' \ + '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' || exit + git config 'diff.texinfo.xfuncname' \ + 'address@hidden:space:]]+([^,[:space:]][^,]+)' || exit + + + # Install Git hooks. + tailored_hooks= sample_hooks= -- 2.1.0