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.
This commit is contained in:
parent
db828f62f6
commit
e3a6246eff
2 changed files with 18 additions and 2 deletions
4
.gitattributes
vendored
4
.gitattributes
vendored
|
@ -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
|
||||
|
|
16
autogen.sh
16
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=
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue