Re: [PATCH] diff-options.txt: avoid "regex" overload in example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin,

On Thu, Feb 06, 2020 at 09:53:01PM +0100, Martin Ågren wrote:
> When we exemplify the difference between `-G` and `-S` (using
> `--pickaxe-regex`), we do so using an example diff and git-diff
> invocation involving "regexec", "regexp", "regmatch", ...
>
> The example is correct, but we can make it easier to untangle by
> avoiding writing "regex.*" unless it's really needed to make our point.
>
> Use some made-up, non-regexy words instead.

This is a good idea, and I think that it removes additional, unnecessary
confusion from the documentation here.

> Reported-by: Adam Dinwoodie <adam@xxxxxxxxxxxxx>
> Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx>
> ---
>  Documentation/diff-options.txt | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
> index 09faee3b44..bb31f0c42b 100644
> --- a/Documentation/diff-options.txt
> +++ b/Documentation/diff-options.txt
> @@ -567,13 +567,13 @@ To illustrate the difference between `-S<regex> --pickaxe-regex` and
>  file:
>  +
>  ----
> -+    return !regexec(regexp, two->ptr, 1, &regmatch, 0);
> ++    return frotz(nitfol, two->ptr, 1, 0);
>  ...
> --    hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);
> +-    hit = frotz(nitfol, mf2.ptr, 1, 0);
>  ----
>  +
> -While `git log -G"regexec\(regexp"` will show this commit, `git log
> --S"regexec\(regexp" --pickaxe-regex` will not (because the number of
> +While `git log -G"frotz\(nitfol"` will show this commit, `git log
> +-S"frotz\(nitfol" --pickaxe-regex` will not (because the number of
>  occurrences of that string did not change).
>  +
>  Unless `--text` is supplied patches of binary files without a textconv
> --
> 2.25.0

Thanks for doing it.

  Reviewed-by: Taylor Blau <me@xxxxxxxxxxxx>

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux