{"thread":{"id":"56995","subject":"[PATCH] grep: clarify what `grep.patternType=default` means","startedAt":"2021-11-29T22:12:52Z","lastAt":"2021-12-05T20:26:23Z","messageCount":4,"participants":["Junio C Hamano","Johannes Altmanninger"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"442500","messageId":"xmqq7dcq62af.fsf@gitster.g","threadId":"56995","inReplyTo":null,"subject":"[PATCH] grep: clarify what `grep.patternType=default` means","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-29T22:10:48Z","receivedAt":"2021-11-29T22:12:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Back in the days when the \"return to the default matching behavior\"\npart was written in 84befcd0 (grep: add a grep.patternType\nconfiguration setting, 2012-08-03), grep.extendedRegexp was the only\nway to configure the behaviour since b22520a3 (grep: allow -E and -n\nto be turned on by default via configuration, 2011-03-30).\n\nIt was understandable that we referred to the behaviour that honors\nthe older configuration variable as \"the default matching\"\nbehaviour.  It is fairly clear in its log message:\n\n    When grep.patternType is set to a value other than \"default\", the\n    grep.extendedRegexp setting is ignored. The value of \"default\" restores\n    the current default behavior, including the grep.extendedRegexp\n    behavior.\n\nBut when the paragraph is read in isolation by a new person who is\nnot aware of that backstory (which is the synonym for \"most users\"),\nthe \"default matching behaviour\" can be read as \"how 'git grep'\nbehaves without any configuration variables or options\", which is\n\"match the pattern as BRE\".\n\nClarify what the passage means by elaborating what the phrase\n\"default matching behaviour\" wanted to mean.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Whether the eventual deprecation of grep.extendedRegexp is a good\n   idea, we'd need something like this to clarify what these two\n   variables are meant to interact with each other first.\n\n Documentation/config/grep.txt | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config/grep.txt b/Documentation/config/grep.txt\nindex 44abe45a7c..72f5e03614 100644\n--- a/Documentation/config/grep.txt\n+++ b/Documentation/config/grep.txt\n@@ -8,7 +8,8 @@ grep.patternType::\n \tSet the default matching behavior. Using a value of 'basic', 'extended',\n \t'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,\n \t`--fixed-strings`, or `--perl-regexp` option accordingly, while the\n-\tvalue 'default' will return to the default matching behavior.\n+\tvalue 'default' will use the settings of `grep.extendedRegexp` option\n+\tto choose between `basic` and `extended`.\n \n grep.extendedRegexp::\n \tIf set to true, enable `--extended-regexp` option by default. This\n-- \n2.34.1-251-g6783e24198\n\n"},{"id":"443107","messageId":"20211205133352.ukucgvynpuvypfnn@gmail.com","threadId":"56995","inReplyTo":"xmqq7dcq62af.fsf@gitster.g","subject":"Re: [PATCH] grep: clarify what `grep.patternType=default` means","fromName":"Johannes Altmanninger","fromEmail":"aclopte@gmail.com","sentAt":"2021-12-05T13:33:52Z","receivedAt":"2021-12-05T13:33:59Z","isPatch":true,"sender":{"key":"aclopte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6853872?v=4"},"body":"On Mon, Nov 29, 2021 at 02:10:48PM -0800, Junio C Hamano wrote:\n> Back in the days when the \"return to the default matching behavior\"\n> part was written in 84befcd0 (grep: add a grep.patternType\n> configuration setting, 2012-08-03), grep.extendedRegexp was the only\n> way to configure the behaviour since b22520a3 (grep: allow -E and -n\n> to be turned on by default via configuration, 2011-03-30).\n\nThe 'the \"return to the default matching behavior\" part' is a forward\nreference, so I tried this instead:\n\nCommit 84befcd0 (grep: add a grep.patternType configuration setting,\n2012-08-03) documented that grep.patternType=default falls back to the\n\"default matching behavior\". Prior to that, grep.extendedRegexp was the only\nway to configure the matching behavior (since b22520a3 (grep: allow -E and\n-n to be turned on by default via configuration, 2011-03-30)).\n\n> \n> It was understandable that we referred to the behaviour that honors\n\n\"It was\" -> \"It is\"?\n\n> the older configuration variable as \"the default matching\"\n> behaviour.  It is fairly clear in its log message:\n\nI guess %s/behaviour/behavior/\n\n> \n>     When grep.patternType is set to a value other than \"default\", the\n>     grep.extendedRegexp setting is ignored. The value of \"default\" restores\n>     the current default behavior, including the grep.extendedRegexp\n>     behavior.\n> \n> But when the paragraph is read in isolation by a new person who is\n> not aware of that backstory (which is the synonym for \"most users\"),\n> the \"default matching behaviour\" can be read as \"how 'git grep'\n> behaves without any configuration variables or options\", which is\n> \"match the pattern as BRE\".\n> \n> Clarify what the passage means by elaborating what the phrase\n> \"default matching behaviour\" wanted to mean.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n>  * Whether the eventual deprecation of grep.extendedRegexp is a good\n>    idea, we'd need something like this to clarify what these two\n>    variables are meant to interact with each other first.\n> \n>  Documentation/config/grep.txt | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/Documentation/config/grep.txt b/Documentation/config/grep.txt\n> index 44abe45a7c..72f5e03614 100644\n> --- a/Documentation/config/grep.txt\n> +++ b/Documentation/config/grep.txt\n> @@ -8,7 +8,8 @@ grep.patternType::\n>  \tSet the default matching behavior. Using a value of 'basic', 'extended',\n>  \t'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,\n>  \t`--fixed-strings`, or `--perl-regexp` option accordingly, while the\n> -\tvalue 'default' will return to the default matching behavior.\n> +\tvalue 'default' will use the settings of `grep.extendedRegexp` option\n> +\tto choose between `basic` and `extended`.\n\nYes, much better.\nMaybe \"settings\" -> \"value\". Probably subjective but plural sounds weird\nsince grep.extendedRegexp is just one bit.\n\nAlso this introduces a local inconsistency: above we write 'basic' and here `basic`.\n\n>  \n>  grep.extendedRegexp::\n>  \tIf set to true, enable `--extended-regexp` option by default. This\n> -- \n> 2.34.1-251-g6783e24198\n> \n"},{"id":"443116","messageId":"xmqqy24ykdel.fsf_-_@gitster.g","threadId":"56995","inReplyTo":"20211205133352.ukucgvynpuvypfnn@gmail.com","subject":"Re* [PATCH] grep: clarify what `grep.patternType=default` means","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-12-05T20:25:06Z","receivedAt":"2021-12-05T20:25:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Altmanninger <aclopte@gmail.com> writes:\n\n> On Mon, Nov 29, 2021 at 02:10:48PM -0800, Junio C Hamano wrote:\n>> Back in the days when the \"return to the default matching behavior\"\n>> part was written in 84befcd0 (grep: add a grep.patternType\n>> configuration setting, 2012-08-03), grep.extendedRegexp was the only\n>> way to configure the behaviour since b22520a3 (grep: allow -E and -n\n>> to be turned on by default via configuration, 2011-03-30).\n>\n> The 'the \"return to the default matching behavior\" part' is a forward\n> reference, so I tried this instead:\n>\n> Commit 84befcd0 (grep: add a grep.patternType configuration setting,\n> 2012-08-03) documented that grep.patternType=default falls back to the\n> \"default matching behavior\". Prior to that, grep.extendedRegexp was the only\n> way to configure the matching behavior (since b22520a3 (grep: allow -E and\n> -n to be turned on by default via configuration, 2011-03-30)).\n>\n>> It was understandable that we referred to the behaviour that honors\n>\n> \"It was\" -> \"It is\"?\n>> the older configuration variable as \"the default matching\"\n>> behaviour.  It is fairly clear in its log message:\n>\n> I guess %s/behaviour/behavior/\n\nLet me steal that.\n\n>> diff --git a/Documentation/config/grep.txt b/Documentation/config/grep.txt\n>> index 44abe45a7c..72f5e03614 100644\n>> --- a/Documentation/config/grep.txt\n>> +++ b/Documentation/config/grep.txt\n>> @@ -8,7 +8,8 @@ grep.patternType::\n>>  \tSet the default matching behavior. Using a value of 'basic', 'extended',\n>>  \t'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,\n>>  \t`--fixed-strings`, or `--perl-regexp` option accordingly, while the\n>> -\tvalue 'default' will return to the default matching behavior.\n>> +\tvalue 'default' will use the settings of `grep.extendedRegexp` option\n>> +\tto choose between `basic` and `extended`.\n>\n> Yes, much better.\n> Maybe \"settings\" -> \"value\". Probably subjective but plural sounds weird\n> since grep.extendedRegexp is just one bit.\n>\n> Also this introduces a local inconsistency: above we write 'basic' and here `basic`.\n\nThanks for carefully reading.\n"},{"id":"443117","messageId":"xmqqtufmkdcn.fsf_-_@gitster.g","threadId":"56995","inReplyTo":"xmqqy24ykdel.fsf_-_@gitster.g","subject":"[PATCH v2] grep: clarify what `grep.patternType=default` means","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-12-05T20:26:16Z","receivedAt":"2021-12-05T20:26:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"We documented that with grep.patternType set to default, the \"git\ngrep\" command returns to \"the default matching behavior\" in 84befcd0\n(grep: add a grep.patternType configuration setting, 2012-08-03).\n\nThe grep.extendedRegexp configuration variable was the only way to\nconfigure the behavior before that, after b22520a3 (grep: allow -E\nand -n to be turned on by default via configuration, 2011-03-30)\nintroduced it.\n\nIt is understandable that we referred to the behavior that honors\nthe older configuration variable as \"the default matching\"\nbehavior.  It is fairly clear in its log message:\n\n    When grep.patternType is set to a value other than \"default\", the\n    grep.extendedRegexp setting is ignored. The value of \"default\" restores\n    the current default behavior, including the grep.extendedRegexp\n    behavior.\n\nBut when the paragraph is read in isolation by a new person who is\nnot aware of that backstory (which is the synonym for \"most users\"),\nthe \"default matching behavior\" can be read as \"how 'git grep'\nbehaves without any configuration variables or options\", which is\n\"match the pattern as BRE\".\n\nClarify what the passage means by elaborating what the phrase\n\"default matching behavior\" wanted to mean.\n\nHelped-by: Johannes Altmanninger <aclopte@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n1:  39afc16050 ! 1:  b6a542173b grep: clarify what `grep.patternType=default` means\n    @@ Metadata\n      ## Commit message ##\n         grep: clarify what `grep.patternType=default` means\n     \n    -    Back in the days when the \"return to the default matching behavior\"\n    -    part was written in 84befcd0 (grep: add a grep.patternType\n    -    configuration setting, 2012-08-03), grep.extendedRegexp was the only\n    -    way to configure the behaviour since b22520a3 (grep: allow -E and -n\n    -    to be turned on by default via configuration, 2011-03-30).\n    +    We documented that with grep.patternType set to default, the \"git\n    +    grep\" command returns to \"the default matching behavior\" in 84befcd0\n    +    (grep: add a grep.patternType configuration setting, 2012-08-03).\n     \n    -    It was understandable that we referred to the behaviour that honors\n    +    The grep.extendedRegexp configuration variable was the only way to\n    +    configure the behavior before that, after b22520a3 (grep: allow -E\n    +    and -n to be turned on by default via configuration, 2011-03-30)\n    +    introduced it.\n    +\n    +    It is understandable that we referred to the behavior that honors\n         the older configuration variable as \"the default matching\"\n    -    behaviour.  It is fairly clear in its log message:\n    +    behavior.  It is fairly clear in its log message:\n     \n             When grep.patternType is set to a value other than \"default\", the\n             grep.extendedRegexp setting is ignored. The value of \"default\" restores\n    @@ Commit message\n     \n         But when the paragraph is read in isolation by a new person who is\n         not aware of that backstory (which is the synonym for \"most users\"),\n    -    the \"default matching behaviour\" can be read as \"how 'git grep'\n    +    the \"default matching behavior\" can be read as \"how 'git grep'\n         behaves without any configuration variables or options\", which is\n         \"match the pattern as BRE\".\n     \n         Clarify what the passage means by elaborating what the phrase\n    -    \"default matching behaviour\" wanted to mean.\n    +    \"default matching behavior\" wanted to mean.\n     \n    +    Helped-by: Johannes Altmanninger <aclopte@gmail.com>\n         Signed-off-by: Junio C Hamano <gitster@pobox.com>\n     \n      ## Documentation/config/grep.txt ##\n    @@ Documentation/config/grep.txt: grep.patternType::\n      \t'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,\n      \t`--fixed-strings`, or `--perl-regexp` option accordingly, while the\n     -\tvalue 'default' will return to the default matching behavior.\n    -+\tvalue 'default' will use the settings of `grep.extendedRegexp` option\n    -+\tto choose between `basic` and `extended`.\n    ++\tvalue 'default' will use the `grep.extendedRegexp` option to choose\n    ++\tbetween 'basic' and 'extended'.\n      \n      grep.extendedRegexp::\n      \tIf set to true, enable `--extended-regexp` option by default. This\n\n Documentation/config/grep.txt | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config/grep.txt b/Documentation/config/grep.txt\nindex 44abe45a7c..182edd813a 100644\n--- a/Documentation/config/grep.txt\n+++ b/Documentation/config/grep.txt\n@@ -8,7 +8,8 @@ grep.patternType::\n \tSet the default matching behavior. Using a value of 'basic', 'extended',\n \t'fixed', or 'perl' will enable the `--basic-regexp`, `--extended-regexp`,\n \t`--fixed-strings`, or `--perl-regexp` option accordingly, while the\n-\tvalue 'default' will return to the default matching behavior.\n+\tvalue 'default' will use the `grep.extendedRegexp` option to choose\n+\tbetween 'basic' and 'extended'.\n \n grep.extendedRegexp::\n \tIf set to true, enable `--extended-regexp` option by default. This\n-- \n2.34.1-308-g0a2b0356a8\n\n"}]}