Improve C and Elisp Git diff hunk headers

For discussion, see the following threads:

* Extend the built-in Git xfuncname pattern 'cpp' to
match preprocessor and DEFUN macros, and the 'elisp' pattern to
match cl-lib and other top-level defuns.
parent 4498e5a1
Pipeline #1758 failed with stage
in 6 minutes and 17 seconds
......@@ -315,8 +315,16 @@ git_config transfer.fsckObjects true
# Configure 'git diff' hunk header format.
# This xfuncname is based on Git's built-in 'cpp' pattern.
# The first line rejects jump targets and access declarations.
# The second line matches top-level functions and methods.
# The third line matches preprocessor and DEFUN macros.
git_config diff.cpp.xfuncname \
'!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])
git_config diff.elisp.xfuncname \
git_config 'diff.m4.xfuncname' '^((m4_)?define|A._DEFUN(_ONCE)?)\([^),]*'
git_config 'diff.make.xfuncname' \
'^([$.[:alnum:]_].*:|[[:alnum:]_]+[[:space:]]*([*:+]?[:?]?|!?)=|define .*)'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment