git/t/t4018
Philippe Blain 75c3b6b2e8 userdiff: improve Fortran xfuncname regex
The third part of the Fortran xfuncname regex wants to match the
beginning of a subroutine or function, so it allows for all characters
except `'`, `"` or whitespace before the keyword 'function' or
'subroutine'. This is meant to match the 'recursive', 'elemental' or
'pure' keywords, as well as function return types, and to prevent
matches inside strings.

However, the negated set does not contain the `!` comment character,
so a line with an end-of-line comment containing the keyword 'function' or
'subroutine' followed by another word is mistakenly chosen as a hunk header.

Improve the regex by adding `!` to the negated set.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-13 11:21:18 -07:00
..
cpp-c++-function
cpp-class-constructor
cpp-class-constructor-mem-init
cpp-class-definition
cpp-class-definition-derived
cpp-class-destructor
cpp-function-returning-global-type
cpp-function-returning-nested
cpp-function-returning-pointer
cpp-function-returning-reference
cpp-gnu-style-function
cpp-namespace-definition
cpp-operator-definition
cpp-skip-access-specifiers
cpp-skip-comment-block
cpp-skip-labels
cpp-struct-definition
cpp-struct-single-line
cpp-template-function-definition
cpp-union-definition
cpp-void-c-function
css-brace-in-col-1
css-colon-eol
css-colon-selector
css-common
css-long-selector-list
css-prop-sans-indent
css-short-selector-list
css-trailing-space
custom1-pattern
custom2-match-to-end-of-line
custom3-alternation-in-pattern
dts-labels userdiff: add a builtin pattern for dts files 2019-08-21 15:09:34 -07:00
dts-node-unitless userdiff: add a builtin pattern for dts files 2019-08-21 15:09:34 -07:00
dts-nodes userdiff: add a builtin pattern for dts files 2019-08-21 15:09:34 -07:00
dts-nodes-boolean-prop userdiff: fix some corner cases in dts regex 2019-10-21 17:44:12 +09:00
dts-nodes-comment1 userdiff: add a builtin pattern for dts files 2019-08-21 15:09:34 -07:00
dts-nodes-comment2 userdiff: add a builtin pattern for dts files 2019-08-21 15:09:34 -07:00
dts-nodes-multiline-prop userdiff: fix some corner cases in dts regex 2019-10-21 17:44:12 +09:00
dts-reference userdiff: add a builtin pattern for dts files 2019-08-21 15:09:34 -07:00
dts-root userdiff: fix some corner cases in dts regex 2019-10-21 17:44:12 +09:00
dts-root-comment userdiff: fix some corner cases in dts regex 2019-10-21 17:44:12 +09:00
elixir-do-not-pick-end userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-ex-unit-test userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-function userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-macro userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-module userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-module-func userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-nested-module userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-private-function userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-protocol userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
elixir-protocol-implementation userdiff: add Elixir to supported userdiff languages 2019-11-10 15:26:26 +09:00
fortran-block-data userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-comment userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-comment-keyword userdiff: improve Fortran xfuncname regex 2020-08-13 11:21:18 -07:00
fortran-comment-legacy userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-comment-legacy-star userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-external-function userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-external-subroutine userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-module userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-module-procedure userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fortran-program userdiff: add tests for Fortran xfuncname regex 2020-08-13 11:21:17 -07:00
fountain-scene
golang-complex-function
golang-func
golang-interface
golang-long-func
golang-struct
java-class-member-function
markdown-heading-indented userdiff: support Markdown 2020-05-02 18:04:12 -07:00
markdown-heading-non-headings userdiff: support Markdown 2020-05-02 18:04:12 -07:00
matlab-class-definition userdiff: add Octave 2019-05-19 10:45:28 +09:00
matlab-function userdiff: add Octave 2019-05-19 10:45:28 +09:00
matlab-octave-section-1 userdiff: add Octave 2019-05-19 10:45:28 +09:00
matlab-octave-section-2 userdiff: add Octave 2019-05-19 10:45:28 +09:00
matlab-section userdiff: add Octave 2019-05-19 10:45:28 +09:00
perl-skip-end-of-heredoc
perl-skip-forward-decl
perl-skip-sub-in-pod
perl-sub-definition
perl-sub-definition-kr-brace
php-abstract-class userdiff: support new keywords in PHP hunk header 2018-07-06 14:59:28 -07:00
php-class
php-final-class userdiff: support new keywords in PHP hunk header 2018-07-06 14:59:28 -07:00
php-function
php-interface userdiff: support new keywords in PHP hunk header 2018-07-06 14:59:28 -07:00
php-method
php-trait userdiff: support new keywords in PHP hunk header 2018-07-06 14:59:28 -07:00
python-async-def userdiff: support Python async functions 2019-11-20 16:31:43 +09:00
python-class userdiff: support Python async functions 2019-11-20 16:31:43 +09:00
python-def userdiff: support Python async functions 2019-11-20 16:31:43 +09:00
python-indented-async-def userdiff: support Python async functions 2019-11-20 16:31:43 +09:00
python-indented-class userdiff: support Python async functions 2019-11-20 16:31:43 +09:00
python-indented-def userdiff: support Python async functions 2019-11-20 16:31:43 +09:00
README
rust-fn userdiff: add built-in pattern for rust 2019-05-17 12:54:02 +09:00
rust-impl userdiff: add built-in pattern for rust 2019-05-17 12:54:02 +09:00
rust-struct userdiff: add built-in pattern for rust 2019-05-17 12:54:02 +09:00
rust-trait userdiff: add built-in pattern for rust 2019-05-17 12:54:02 +09:00

How to write RIGHT test cases
=============================

Insert the word "ChangeMe" (exactly this form) at a distance of
at least two lines from the line that must appear in the hunk header.

The text that must appear in the hunk header must contain the word
"right", but in all upper-case, like in the title above.

To mark a test case that highlights a malfunction, insert the word
BROKEN in all lower-case somewhere in the file.

This text is a bit twisted and out of order, but it is itself a
test case for the default hunk header pattern. Know what you are doing
if you change it.

BTW, this tests that the head line goes to the hunk header, not the line
of equal signs.