X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/88bc8332eb14bcc4780fd3fe3dd4de2205c31dbf..9ee6ecb840c57aaf87316bccc2a892265087bafe:/autogen.sh diff --git a/autogen.sh b/autogen.sh index c3ae1d766d..563a0244ca 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 && (git status -s) >/dev/null 2>&1; 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= @@ -226,6 +238,7 @@ if test -d .git/hooks; then tailored_hooks="$tailored_hooks $hook" done for hook in applypatch-msg pre-applypatch; do + test ! -r .git/hooks/$hook.sample || cmp .git/hooks/$hook.sample .git/hooks/$hook >/dev/null 2>&1 || sample_hooks="$sample_hooks $hook" done