diff --git a/.gitattributes b/.gitattributes index 21af4e68770c8a595933eed068cc93ded8eee8ff..ac26a2bbcd2ecdfbc92826a41c62cbf54d2d73ea 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 bc9c5a008e034479aa1c146332de6f0b318399c4..926915c1af1e985834a98b91c7eaf234994a56f8 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' \ + '^@node[[:space:]]+([^,[:space:]][^,]+)' || exit + + + # Install Git hooks. + tailored_hooks= sample_hooks=