Subject: Re: [PATCH v5 02/10] diff: -G description: Correct copy/paste error

From: Junio C Hamano <[email-masked]>
Date: Wed, 12 Feb 2025 20:16:16 -0800

Illia Bobyr <[email-masked]> writes:

> Current description for -G is incorrect, seems like it was copied from
> the description for -S.
> ---
>  diff.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

[jc: I won't point out about the title and sign-off, which are the
same issues [1/10] had and maybe shared with the later patches]

>
> diff --git a/diff.c b/diff.c
> index 019fb..bd9db 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -5866,7 +5866,7 @@ struct option *add_diff_options(const struct option *opts,
>  			       N_("look for differences that change the number of occurrences of the specified string"),
>  			       0, diff_opt_pickaxe_string),
>  		OPT_CALLBACK_F('G', NULL, options, N_("<regex>"),
> -			       N_("look for differences that change the number of occurrences of the specified regex"),
> +			       N_("look for differences where a patch contains the specified regex"),

Yeah, but the updated one is not all that great, either.  -S looks
for string, so either "occurences" or "contains" would work, but
a patch that "contains" the regular expression would not necessarily
match with -G ;-) 

"a patch contains a line that matches" is closer but not correct.

What the option looks for is if there is a changed line in the patch
that matches the given regular expression.  If a context line shared
between the preimage and the postimage matches the regular expression
that does not count as a "hit".

    N_("find differences with changed lines that match the given regex").

perhaps?

Again, this is "preliminary clean-up" (or "after-the-dust-settles")
material and shouldn't be part of the main series.

Thanks.