Subject: Re: [PATCH v2 1/1] userdiff: extend Bash pattern to cover more shell function forms

From: Junio C Hamano <[email-masked]>
Date: Tue, 18 Feb 2025 15:38:12 -0800

Moumita <[email-masked]> writes:

> From: Moumita Dhar <[email-masked]>
>
> 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 <[email-masked]>

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.