aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-03-13 12:20:01 -0700
committerPaul Eggert2016-03-13 12:58:30 -0700
commit181e92c4e060a7ce4740b561375f9ec9f473f144 (patch)
tree6d0688109d99ac387e1f6739323862c85d4b26ed
parent32a4d2ee2c1a1a8f157ebb2e9b62bc53e74cf4f8 (diff)
downloademacs-181e92c4e060a7ce4740b561375f9ec9f473f144.tar.gz
emacs-181e92c4e060a7ce4740b561375f9ec9f473f144.zip
Improve diff hunk headers when maintaining Emacs
* .gitattributes: Improve diff hunk header support for makefiles, shell scripts, Ada, C, C++, Objective C, HTML, SHTML, XML, Java, Perl, PHP, Python, Ruby, and TeX, all of which are used in Emacs somewhere (sometimes just in test cases). * autogen.sh: Add regexes for makefiles and shell scripts.
-rw-r--r--.gitattributes46
-rwxr-xr-xautogen.sh5
2 files changed, 51 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index 5ccf9a5eabb..13e58a87e9f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -47,6 +47,52 @@ doc/misc/texinfo.tex -whitespace=blank-at-eol
47*.tiff binary 47*.tiff binary
48etc/e/eterm-color binary 48etc/e/eterm-color binary
49 49
50# Git's builtin diff hunk header styles.
51*.ada diff=ada
52*.[ch] diff=cpp
53*.cc diff=cpp
54*.cpp diff=cpp
55*.hh diff=cpp
56*.for diff=fortran
57*.html diff=html
58*.shtml diff=html
59*.xml diff=html
60*.java diff=java
61*.m diff=objc
62*.perl diff=perl
63*.pl diff=perl
64*.php diff=php
65*.py diff=python
66*.rb diff=ruby
67*.ruby diff=ruby
68*.tex diff=tex
69
50# Hooks for non-default diff hunk headers; see autogen.sh. 70# Hooks for non-default diff hunk headers; see autogen.sh.
51*.el diff=elisp 71*.el diff=elisp
72*.ac diff=m4
73*.m4 diff=m4
74*.mk diff=make
75*[Mm]akefile diff=make
76Makefile.in diff=make
77*.sh diff=shell
52*.texi diff=texinfo 78*.texi diff=texinfo
79#
80# Diff hunk header special-case file names.
81admin/build-configs diff=perl
82admin/charsets/mapconv diff=shell
83admin/diff-tar-files diff=shell
84admin/make-emacs diff=perl
85admin/merge-gnulib diff=shell
86admin/merge-pkg-config diff=shell
87admin/quick-install-emacs diff=shell
88admin/update-copyright diff=shell
89admin/update_autogen diff=shell
90build-aux/git-hooks/commit-msg diff=shell
91build-aux/git-hooks/pre-commit diff=shell
92build-aux/gitlog-to-emacslog diff=shell
93build-aux/make-info-dir diff=shell
94build-aux/move-if-change diff=shell
95build-aux/msys-to-w32 diff=shell
96build-aux/update-subdirs diff=shell
97lib-src/rcs2log diff=shell
98/make-dist diff=shell
diff --git a/autogen.sh b/autogen.sh
index ac728ccd521..904246509fa 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -281,6 +281,11 @@ git_config transfer.fsckObjects true
281 281
282git_config diff.elisp.xfuncname \ 282git_config diff.elisp.xfuncname \
283 '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' 283 '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)'
284git_config 'diff.m4.xfuncname' '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
285git_config 'diff.make.xfuncname' \
286 '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
287git_config 'diff.shell.xfuncname' \
288 '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)'
284git_config diff.texinfo.xfuncname \ 289git_config diff.texinfo.xfuncname \
285 '^@node[[:space:]]+([^,[:space:]][^,]+)' 290 '^@node[[:space:]]+([^,[:space:]][^,]+)'
286 291