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
b22520a37c (grep: allow -E and -n to be turned on by default via
configuration, 2011-03-30). After that in e.g. 6453f7b348 (grep: add
grep.fullName config variable, 2014-03-17) they started drifting
apart, with only grep.fullName being described in the command
documentation.

In 434e6e753f (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 <avarab@gmail.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2022-09-07 10:26:58 +02:00 committed by Junio C Hamano
parent 18d89fe25c
commit a2811dd7c4
2 changed files with 7 additions and 29 deletions

View File

@ -17,8 +17,11 @@ grep.extendedRegexp::
other than 'default'. other than 'default'.
grep.threads:: grep.threads::
Number of grep worker threads to use. Number of grep worker threads to use. If unset (or set to 0), Git will
See `grep.threads` in linkgit:git-grep[1] for more information. use as many threads as the number of logical cores available.
grep.fullName::
If set to true, enable `--full-name` option by default.
grep.fallbackToNoIndex:: grep.fallbackToNoIndex::
If set to true, fall back to git grep --no-index if git grep If set to true, fall back to git grep --no-index if git grep

View File

@ -343,34 +343,9 @@ performance in this case, it might be desirable to use `--threads=1`.
CONFIGURATION CONFIGURATION
------------- -------------
grep.lineNumber:: include::includes/cmd-config-section-all.txt[]
If set to true, enable `-n` option by default.
grep.column::
If set to true, enable the `--column` option by default.
grep.patternType::
Set the default matching behavior. Using a value of 'basic', 'extended',
'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,
`--fixed-strings`, or `--perl-regexp` option accordingly, while the
value 'default' will return to the default matching behavior.
grep.extendedRegexp::
If set to true, enable `--extended-regexp` option by default. This
option is ignored when the `grep.patternType` option is set to a value
other than 'default'.
grep.threads::
Number of grep worker threads to use. If unset (or set to 0), Git will
use as many threads as the number of logical cores available.
grep.fullName::
If set to true, enable `--full-name` option by default.
grep.fallbackToNoIndex::
If set to true, fall back to git grep --no-index if git grep
is executed outside of a git repository. Defaults to false.
include::config/grep.txt[]
GIT GIT
--- ---