Message ID | 20250212032657.1807939-3-illia.bobyr@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Long names for `git log -S` and `git log -G` | expand |
Illia Bobyr <illia.bobyr@gmail.com> 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.
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"), 0, diff_opt_pickaxe_regex), OPT_BIT_F(0, "pickaxe-all", &options->pickaxe_opts, N_("show all changes in the changeset with -S or -G"),