Skip to content

Commit 91028f7

Browse files
committed
grep: clarify what grep.patternType=default means
We documented that with grep.patternType set to default, the "git grep" command returns to "the default matching behavior" in 84befcd (grep: add a grep.patternType configuration setting, 2012-08-03). The grep.extendedRegexp configuration variable was the only way to configure the behavior before that, after b22520a (grep: allow -E and -n to be turned on by default via configuration, 2011-03-30) introduced it. It is understandable that we referred to the behavior that honors the older configuration variable as "the default matching" behavior. It is fairly clear in its log message: When grep.patternType is set to a value other than "default", the grep.extendedRegexp setting is ignored. The value of "default" restores the current default behavior, including the grep.extendedRegexp behavior. But when the paragraph is read in isolation by a new person who is not aware of that backstory (which is the synonym for "most users"), the "default matching behavior" can be read as "how 'git grep' behaves without any configuration variables or options", which is "match the pattern as BRE". Clarify what the passage means by elaborating what the phrase "default matching behavior" wanted to mean. Helped-by: Johannes Altmanninger <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9d7761 commit 91028f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Documentation/config/grep.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ grep.patternType::
88
Set the default matching behavior. Using a value of 'basic', 'extended',
99
'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,
1010
`--fixed-strings`, or `--perl-regexp` option accordingly, while the
11-
value 'default' will return to the default matching behavior.
11+
value 'default' will use the `grep.extendedRegexp` option to choose
12+
between 'basic' and 'extended'.
1213

1314
grep.extendedRegexp::
1415
If set to true, enable `--extended-regexp` option by default. This

0 commit comments

Comments
 (0)