@matheusbsbs / matheus-bagliano / commits / 9299f84921
Fork 0

diff-options.txt: avoid "regex" overload in example

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. Reported-by: Adam Dinwoodie <adam@dinwoodie.org> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Martin Ågren committed Feb 6, 2020 at 21:53 UTC 9299f84921e0bd076cf998aa852fadb73627756f
1 file changed +4 -4
Documentation/diff-options.txt
+4 -4
@@ -567,13 +567,13 @@ To illustrate the difference between `-S<regex> --pickaxe-regex` and
567 file:
568 +
569 ----
570 -+ return !regexec(regexp, two->ptr, 1, &regmatch, 0);
570 ++ return frotz(nitfol, two->ptr, 1, 0);
571 ...
572 -- hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);
572 +- hit = frotz(nitfol, mf2.ptr, 1, 0);
573 ----
574 +
575 -While `git log -G"regexec\(regexp"` will show this commit, `git log
576 --S"regexec\(regexp" --pickaxe-regex` will not (because the number of
575 +While `git log -G"frotz\(nitfol"` will show this commit, `git log
576 +-S"frotz\(nitfol" --pickaxe-regex` will not (because the number of
577 occurrences of that string did not change).
578 +
579 Unless `--text` is supplied patches of binary files without a textconv