git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Taylor Blau <me@ttaylorr.com>
Date
Feb 8, 2020, 23:24 UTC
Message-ID
<20200208232405.GC33529@syl.local>
In-Reply-To
<20200206205301.27367-1-martin.agren@gmail.com>
Hi Martin,
On Thu, Feb 06, 2020 at 09:53:01PM +0100, Martin Ågren wrote:
Show 8 quoted lines
> 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.

Show 30 quoted lines
> Reported-by: Adam Dinwoodie <adam@dinwoodie.org>
> Signed-off-by: Martin Ågren <martin.agren@gmail.com>
> ---
>  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@ttaylorr.com>

Thanks, Taylor

Previous: Martin ÅgrenNext: Junio C Hamano
Message 6 of 7 in “diff-options.txt: correct command syntax”
  1. diff-options.txt: correct command syntaxAdam Dinwoodie, Feb 2, 2020
  2. Martin ÅgrenFeb 2, 2020
  3. Adam DinwoodieFeb 2, 2020
  4. Martin ÅgrenFeb 3, 2020
  5. diff-options.txt: avoid "regex" overload in exampleMartin Ågren, Feb 6, 2020
  6. Taylor BlauFeb 8, 2020
  7. Junio C HamanoFeb 9, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.