Re: [PATCH v2 1/1] userdiff: extend Bash pattern to cover more shell function forms
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 18, 2025, 23:38 UTC
- Message-ID
- <xmqq34gaj02j.fsf@gitster.g>
- In-Reply-To
- <20250218153537.16320-2-dhar61595@gmail.com>
Moumita <dhar61595@gmail.com> writes:
Show 12 quoted lines
> From: Moumita Dhar <dhar61595@gmail.com> > > The existing Bash userdiff pattern misses some shell function forms, such as > `function foo()`, multi-line definitions, and extra whitespace. > > Extend the pattern to: > - Support `function foo()` syntax. > - Allow spaces in `foo ( )` definitions. > - Recognize multi-line definitions with backslashes. > - Broaden function body detection. > > Signed-off-by: Moumita Dhar <dhar61595@gmail.com>
Applied to any one of the recent tips of 'master', this seemed break tests and the reproduction seems to be quite easy.
$ make
$ cd t && sh t4018-*.sh -i -v
...
test_expect_code: command exited with 128, we wanted 1 ...
not ok 6 - builtin bash pattern compiles
#...
# test_grep ! fatal msg &&
# test_grep ! error msg
#
$ cat t/trash*.t4018*/msg
fatal: Invalid regexp to look for hunk header: ^[ ]*(([a-z...Please make it a habit to run tests after you modified the code before sending out patches with the modifications.
Thanks.