Skip to content

Commit 3e23443

Browse files
ilya-bobyrgitster
authored andcommitted
docs: gitdiffcore: -G and -S: Use regex/string placeholders
In the rest of the documentation (and in the code) we use `regex` and `string` as `-G` and `-S` argument placeholders. While `regular-expression` and `block-of-text` are a bit easier to read, it is a bit consistent. And we could assume that everyone who uses git should be able to understand that a "string" and a "block-of-text", as well as a "regex" and "regular-expression" are the same thing. So, using a shorter version is also more consistent. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3887614 commit 3e23443

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Documentation/gitdiffcore.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,26 +245,25 @@ diffcore-pickaxe: For Detecting Addition/Deletion of Specified String
245245

246246
This transformation limits the set of filepairs to those that change
247247
specified strings between the preimage and the postimage in a certain
248-
way. -S<block-of-text> and -G<regular-expression> options are used to
249-
specify different ways these strings are sought.
248+
way. `-S<string>` and `-G<regex>` options are used to specify
249+
different ways these strings are sought.
250250

251-
"-S<block-of-text>" detects filepairs whose preimage and postimage
252-
have different number of occurrences of the specified block of text.
251+
`-S<string>` detects filepairs whose preimage and postimage
252+
have different number of occurrences of the specified _<string>_.
253253
By definition, it will not detect in-file moves. Also, when a
254254
changeset moves a file wholesale without affecting the interesting
255255
string, diffcore-rename kicks in as usual, and `-S` omits the filepair
256256
(since the number of occurrences of that string didn't change in that
257257
rename-detected filepair). When used with `--pickaxe-regex`, treat
258-
the <block-of-text> as an extended POSIX regular expression to match,
258+
the _<string>_ as an extended POSIX regular expression to match,
259259
instead of a literal string.
260260

261-
"-G<regular-expression>" (mnemonic: grep) detects filepairs whose
262-
textual diff has an added or a deleted line that matches the given
263-
regular expression. This means that it will detect in-file (or what
264-
rename-detection considers the same file) moves, which is noise. The
265-
implementation runs diff twice and greps, and this can be quite
266-
expensive. To speed things up, binary files without textconv filters
267-
will be ignored.
261+
`-G<regex>` (mnemonic: grep) detects filepairs whose textual diff has
262+
an added or a deleted line that matches the given _<regex>_. This
263+
means that it will detect in-file (or what rename-detection considers
264+
the same file) moves, which is noise. The implementation runs diff
265+
twice and greps, and this can be quite expensive. To speed things up,
266+
binary files without textconv filters will be ignored.
268267

269268
When `-S` or `-G` are used without `--pickaxe-all`, only filepairs
270269
that match their respective criterion are kept in the output. When

0 commit comments

Comments
 (0)