git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re* [PATCH] grep: clarify what `grep.patternType=default` means

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 5, 2021, 20:25 UTC
Message-ID
<xmqqy24ykdel.fsf_-_@gitster.g>
In-Reply-To
<20211205133352.ukucgvynpuvypfnn@gmail.com>
Johannes Altmanninger <aclopte@gmail.com> writes:
Show 23 quoted lines
> On Mon, Nov 29, 2021 at 02:10:48PM -0800, Junio C Hamano wrote:
>> Back in the days when the "return to the default matching behavior"
>> part was written in 84befcd0 (grep: add a grep.patternType
>> configuration setting, 2012-08-03), grep.extendedRegexp was the only
>> way to configure the behaviour since b22520a3 (grep: allow -E and -n
>> to be turned on by default via configuration, 2011-03-30).
>
> The 'the "return to the default matching behavior" part' is a forward
> reference, so I tried this instead:
>
> Commit 84befcd0 (grep: add a grep.patternType configuration setting,
> 2012-08-03) documented that grep.patternType=default falls back to the
> "default matching behavior". Prior to that, grep.extendedRegexp was the only
> way to configure the matching behavior (since b22520a3 (grep: allow -E and
> -n to be turned on by default via configuration, 2011-03-30)).
>
>> It was understandable that we referred to the behaviour that honors
>
> "It was" -> "It is"?
>> the older configuration variable as "the default matching"
>> behaviour.  It is fairly clear in its log message:
>
> I guess %s/behaviour/behavior/
Let me steal that.
Show 17 quoted lines
>> diff --git a/Documentation/config/grep.txt b/Documentation/config/grep.txt
>> index 44abe45a7c..72f5e03614 100644
>> --- a/Documentation/config/grep.txt
>> +++ b/Documentation/config/grep.txt
>> @@ -8,7 +8,8 @@ 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.
>> +	value 'default' will use the settings of `grep.extendedRegexp` option
>> +	to choose between `basic` and `extended`.
>
> Yes, much better.
> Maybe "settings" -> "value". Probably subjective but plural sounds weird
> since grep.extendedRegexp is just one bit.
>
> Also this introduces a local inconsistency: above we write 'basic' and here `basic`.
Thanks for carefully reading.
Previous: Johannes AltmanningerNext: Junio C Hamano
Message 3 of 4 in “grep: clarify what `grep.patternType=default` means”
  1. grep: clarify what `grep.patternType=default` meansJunio C Hamano, Nov 29, 2021
  2. Johannes AltmanningerDec 5, 2021
  3. Re* [PATCH] grep: clarify what `grep.patternType=default` meansJunio C Hamano, Dec 5, 2021
  4. grep: clarify what `grep.patternType=default` meansJunio C Hamano, Dec 5, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.