diff options
| author | Paul Eggert | 2016-03-13 12:20:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-03-13 12:58:30 -0700 |
| commit | 181e92c4e060a7ce4740b561375f9ec9f473f144 (patch) | |
| tree | 6d0688109d99ac387e1f6739323862c85d4b26ed | |
| parent | 32a4d2ee2c1a1a8f157ebb2e9b62bc53e74cf4f8 (diff) | |
| download | emacs-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-- | .gitattributes | 46 | ||||
| -rwxr-xr-x | autogen.sh | 5 |
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 |
| 48 | etc/e/eterm-color binary | 48 | etc/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 | ||
| 76 | Makefile.in diff=make | ||
| 77 | *.sh diff=shell | ||
| 52 | *.texi diff=texinfo | 78 | *.texi diff=texinfo |
| 79 | # | ||
| 80 | # Diff hunk header special-case file names. | ||
| 81 | admin/build-configs diff=perl | ||
| 82 | admin/charsets/mapconv diff=shell | ||
| 83 | admin/diff-tar-files diff=shell | ||
| 84 | admin/make-emacs diff=perl | ||
| 85 | admin/merge-gnulib diff=shell | ||
| 86 | admin/merge-pkg-config diff=shell | ||
| 87 | admin/quick-install-emacs diff=shell | ||
| 88 | admin/update-copyright diff=shell | ||
| 89 | admin/update_autogen diff=shell | ||
| 90 | build-aux/git-hooks/commit-msg diff=shell | ||
| 91 | build-aux/git-hooks/pre-commit diff=shell | ||
| 92 | build-aux/gitlog-to-emacslog diff=shell | ||
| 93 | build-aux/make-info-dir diff=shell | ||
| 94 | build-aux/move-if-change diff=shell | ||
| 95 | build-aux/msys-to-w32 diff=shell | ||
| 96 | build-aux/update-subdirs diff=shell | ||
| 97 | lib-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 | ||
| 282 | git_config diff.elisp.xfuncname \ | 282 | git_config diff.elisp.xfuncname \ |
| 283 | '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' | 283 | '^\(def[^[:space:]]+[[:space:]]+([^()[:space:]]+)' |
| 284 | git_config 'diff.m4.xfuncname' '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*' | ||
| 285 | git_config 'diff.make.xfuncname' \ | ||
| 286 | '^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)' | ||
| 287 | git_config 'diff.shell.xfuncname' \ | ||
| 288 | '^([[:space:]]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*\(\)|[[:alpha:]_][[:alnum:]_]*=)' | ||
| 284 | git_config diff.texinfo.xfuncname \ | 289 | git_config diff.texinfo.xfuncname \ |
| 285 | '^@node[[:space:]]+([^,[:space:]][^,]+)' | 290 | '^@node[[:space:]]+([^,[:space:]][^,]+)' |
| 286 | 291 | ||