Skip to content

Commit a2811dd

Browse files
avargitster
authored andcommitted
grep docs: de-duplicate configuration sections
Include the "config/grep.txt" file in "git-grep.txt", instead of repeating an almost identical description of the "grep" configuration variables in two places. There is no loss of information here that isn't shown in the addition to "grep.txt". This change was made by copying the contents of "git-grep.txt"'s version over the "grep.txt" version. Aside from the change "grep.txt" being made here the two were identical. This documentation started being copy/pasted around in b22520a (grep: allow -E and -n to be turned on by default via configuration, 2011-03-30). After that in e.g. 6453f7b (grep: add grep.fullName config variable, 2014-03-17) they started drifting apart, with only grep.fullName being described in the command documentation. In 434e6e7 (config.txt: move grep.* to a separate file, 2018-10-27) we gained the include, but didn't do this next step, let's do it now. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Reviewed-by: Matheus Tavares <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 18d89fe commit a2811dd

File tree

2 files changed

+7
-29
lines changed

2 files changed

+7
-29
lines changed

Documentation/config/grep.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ grep.extendedRegexp::
1717
other than 'default'.
1818

1919
grep.threads::
20-
Number of grep worker threads to use.
21-
See `grep.threads` in linkgit:git-grep[1] for more information.
20+
Number of grep worker threads to use. If unset (or set to 0), Git will
21+
use as many threads as the number of logical cores available.
22+
23+
grep.fullName::
24+
If set to true, enable `--full-name` option by default.
2225

2326
grep.fallbackToNoIndex::
2427
If set to true, fall back to git grep --no-index if git grep

Documentation/git-grep.txt

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -343,34 +343,9 @@ performance in this case, it might be desirable to use `--threads=1`.
343343
CONFIGURATION
344344
-------------
345345

346-
grep.lineNumber::
347-
If set to true, enable `-n` option by default.
348-
349-
grep.column::
350-
If set to true, enable the `--column` option by default.
351-
352-
grep.patternType::
353-
Set the default matching behavior. Using a value of 'basic', 'extended',
354-
'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,
355-
`--fixed-strings`, or `--perl-regexp` option accordingly, while the
356-
value 'default' will return to the default matching behavior.
357-
358-
grep.extendedRegexp::
359-
If set to true, enable `--extended-regexp` option by default. This
360-
option is ignored when the `grep.patternType` option is set to a value
361-
other than 'default'.
362-
363-
grep.threads::
364-
Number of grep worker threads to use. If unset (or set to 0), Git will
365-
use as many threads as the number of logical cores available.
366-
367-
grep.fullName::
368-
If set to true, enable `--full-name` option by default.
369-
370-
grep.fallbackToNoIndex::
371-
If set to true, fall back to git grep --no-index if git grep
372-
is executed outside of a git repository. Defaults to false.
346+
include::includes/cmd-config-section-all.txt[]
373347

348+
include::config/grep.txt[]
374349

375350
GIT
376351
---

0 commit comments

Comments
 (0)