{"thread":{"id":"57089","subject":"[PATCH 0/1] grep: align default colors with GNU grep ones","startedAt":"2021-12-16T12:06:12Z","lastAt":"2022-01-05T08:21:11Z","messageCount":7,"participants":["Lénaïc Huard","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"444201","messageId":"20211216115622.85506-1-lenaic@lhuard.fr","threadId":"57089","inReplyTo":null,"subject":"[PATCH 0/1] grep: align default colors with GNU grep ones","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2021-12-16T11:56:21Z","receivedAt":"2021-12-16T12:06:12Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"git-grep shares a lot of options with the standard grep tool.\nLike GNU grep, it has coloring options to highlight the matching text.\nAnd like it, it has options to customize the various colored parts.\n\nThis patch updates the default git-grep colors to make them match the\nGNU grep default ones [1].\n\nIt was possible to get the same result by setting the various `color.grep.<slot>`\noptions, but this patch makes `git grep --color` share the same color scheme as\n`grep --color` by default without any user configuration.\n\n[1] https://www.man7.org/linux/man-pages/man1/grep.1.html#ENVIRONMENT\n\nLénaïc Huard (1):\n  grep: align default colors with GNU grep ones\n\n grep.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n-- \n2.34.1\n\n"},{"id":"444202","messageId":"20211216115622.85506-2-lenaic@lhuard.fr","threadId":"57089","inReplyTo":"20211216115622.85506-1-lenaic@lhuard.fr","subject":"[PATCH 1/1] grep: align default colors with GNU grep ones","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2021-12-16T11:56:22Z","receivedAt":"2021-12-16T12:06:13Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"Signed-off-by: Lénaïc Huard <lenaic@lhuard.fr>\n---\n grep.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/grep.c b/grep.c\nindex fe847a0111..ca4f321cb3 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -26,10 +26,10 @@ static struct grep_opt grep_defaults = {\n \t.pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED,\n \t.colors = {\n \t\t[GREP_COLOR_CONTEXT] = \"\",\n-\t\t[GREP_COLOR_FILENAME] = \"\",\n+\t\t[GREP_COLOR_FILENAME] = GIT_COLOR_MAGENTA,\n \t\t[GREP_COLOR_FUNCTION] = \"\",\n-\t\t[GREP_COLOR_LINENO] = \"\",\n-\t\t[GREP_COLOR_COLUMNNO] = \"\",\n+\t\t[GREP_COLOR_LINENO] = GIT_COLOR_GREEN,\n+\t\t[GREP_COLOR_COLUMNNO] = GIT_COLOR_GREEN,\n \t\t[GREP_COLOR_MATCH_CONTEXT] = GIT_COLOR_BOLD_RED,\n \t\t[GREP_COLOR_MATCH_SELECTED] = GIT_COLOR_BOLD_RED,\n \t\t[GREP_COLOR_SELECTED] = \"\",\n-- \n2.34.1\n\n"},{"id":"444268","messageId":"xmqqh7b88b3o.fsf@gitster.g","threadId":"57089","inReplyTo":"20211216115622.85506-1-lenaic@lhuard.fr","subject":"Re: [PATCH 0/1] grep: align default colors with GNU grep ones","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-12-16T21:59:39Z","receivedAt":"2021-12-16T21:59:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lénaïc Huard <lenaic@lhuard.fr> writes:\n\n> git-grep shares a lot of options with the standard grep tool.\n> Like GNU grep, it has coloring options to highlight the matching text.\n> And like it, it has options to customize the various colored parts.\n>\n> This patch updates the default git-grep colors to make them match the\n> GNU grep default ones [1].\n>\n> It was possible to get the same result by setting the various `color.grep.<slot>`\n> options, but this patch makes `git grep --color` share the same color scheme as\n> `grep --color` by default without any user configuration.\n\nI am not a huge fan of adjusting our defaults to other people's\ndefault, since it will lead do an inevitable \"Why don't they adjust\nto match ours?\" question, plus \"We've been happily using the default\ncoloring, and you suddenly changed it to something ugly. We want our\ncolor back and we do not care that now you match what GNU does\".\n\nThe UI color choice is so personal, which does not help us either.\n\nHaving said that, I'll keep an eye on what others say on this\nthread.\n\nThanks.\n\n"},{"id":"445368","messageId":"xmqq4k6kjvdd.fsf@gitster.g","threadId":"57089","inReplyTo":"xmqqh7b88b3o.fsf@gitster.g","subject":"Re: [PATCH 0/1] grep: align default colors with GNU grep ones","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-01-03T22:40:46Z","receivedAt":"2022-01-03T22:40:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Lénaïc Huard <lenaic@lhuard.fr> writes:\n>\n>> git-grep shares a lot of options with the standard grep tool.\n>> Like GNU grep, it has coloring options to highlight the matching text.\n>> And like it, it has options to customize the various colored parts.\n>>\n>> This patch updates the default git-grep colors to make them match the\n>> GNU grep default ones [1].\n>>\n>> It was possible to get the same result by setting the various `color.grep.<slot>`\n>> options, but this patch makes `git grep --color` share the same color scheme as\n>> `grep --color` by default without any user configuration.\n>\n> I am not a huge fan of adjusting our defaults to other people's\n> default, since it will lead do an inevitable \"Why don't they adjust\n> to match ours?\" question, plus \"We've been happily using the default\n> coloring, and you suddenly changed it to something ugly. We want our\n> color back and we do not care that now you match what GNU does\".\n>\n> The UI color choice is so personal, which does not help us either.\n>\n> Having said that, I'll keep an eye on what others say on this\n> thread.\n\nIt's been a bit more than a week and it seems nobody else is\ninterested in supporting this change [*1*].\n\nWhether we want this change or not, I just noticed that the real\npatch [1/1] has no commit log message, and most of what is in the\nabove \"cover letter\" would would make a good material for the log\nmessage.  Perhaps we'd want to redo the log message if it turns out\nthat we want to take this change.\n\nThanks.\n\n\n[Footnote]\n\n*1* \"Nobody is against\" is not even an argument, by the way.  If we\n    took changes only because they see no objection, we will force\n    reviewers to shoot down all nonsense changes and wear them down.\n    The default for any new change is \"not to apply\" until it turns\n    out that it is beneficial.\n"},{"id":"445507","messageId":"20220105081835.4949-1-lenaic@lhuard.fr","threadId":"57089","inReplyTo":"20211216115622.85506-1-lenaic@lhuard.fr","subject":"[PATCH v2 0/1] grep: align default colors with GNU grep ones","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2022-01-05T08:18:34Z","receivedAt":"2022-01-05T08:19:05Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"I’ve re-rolled this patch only to move the change description from the\ncover letter to the commit message.\nExcept from that, there is no change in the code at all.\n\nLénaïc Huard (1):\n  grep: align default colors with GNU grep ones\n\n grep.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\n-- \n2.34.1\n\n"},{"id":"445508","messageId":"20220105081835.4949-2-lenaic@lhuard.fr","threadId":"57089","inReplyTo":"20220105081835.4949-1-lenaic@lhuard.fr","subject":"[PATCH v2 1/1] grep: align default colors with GNU grep ones","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2022-01-05T08:18:35Z","receivedAt":"2022-01-05T08:19:06Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"git-grep shares a lot of options with the standard grep tool.\nLike GNU grep, it has coloring options to highlight the matching text.\nAnd like it, it has options to customize the various colored parts.\n\nThis patch updates the default git-grep colors to make them match the\nGNU grep default ones [1].\n\nIt was possible to get the same result by setting the various `color.grep.<slot>`\noptions, but this patch makes `git grep --color` share the same color scheme as\n`grep --color` by default without any user configuration.\n\n[1] https://www.man7.org/linux/man-pages/man1/grep.1.html#ENVIRONMENT\n\nSigned-off-by: Lénaïc Huard <lenaic@lhuard.fr>\n---\n grep.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/grep.c b/grep.c\nindex fe847a0111..ca4f321cb3 100644\n--- a/grep.c\n+++ b/grep.c\n@@ -26,10 +26,10 @@ static struct grep_opt grep_defaults = {\n \t.pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED,\n \t.colors = {\n \t\t[GREP_COLOR_CONTEXT] = \"\",\n-\t\t[GREP_COLOR_FILENAME] = \"\",\n+\t\t[GREP_COLOR_FILENAME] = GIT_COLOR_MAGENTA,\n \t\t[GREP_COLOR_FUNCTION] = \"\",\n-\t\t[GREP_COLOR_LINENO] = \"\",\n-\t\t[GREP_COLOR_COLUMNNO] = \"\",\n+\t\t[GREP_COLOR_LINENO] = GIT_COLOR_GREEN,\n+\t\t[GREP_COLOR_COLUMNNO] = GIT_COLOR_GREEN,\n \t\t[GREP_COLOR_MATCH_CONTEXT] = GIT_COLOR_BOLD_RED,\n \t\t[GREP_COLOR_MATCH_SELECTED] = GIT_COLOR_BOLD_RED,\n \t\t[GREP_COLOR_SELECTED] = \"\",\n-- \n2.34.1\n\n"},{"id":"445509","messageId":"12926486.uLZWGnKmhe@coruscant.lhuard.fr","threadId":"57089","inReplyTo":"xmqq4k6kjvdd.fsf@gitster.g","subject":"Re: [PATCH 0/1] grep: align default colors with GNU grep ones","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr","sentAt":"2022-01-05T08:21:02Z","receivedAt":"2022-01-05T08:21:11Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr","avatar":"https://avatars.githubusercontent.com/u/1437785?v=4"},"body":"Le lundi 3 janvier 2022, 23:40:46 CET Junio C Hamano a écrit :\n> Junio C Hamano <gitster@pobox.com> writes:\n> > […]\n> > \n> > The UI color choice is so personal, which does not help us either.\n> > \n> > Having said that, I'll keep an eye on what others say on this\n> > thread.\n> \n> It's been a bit more than a week and it seems nobody else is\n> interested in supporting this change [*1*].\n> \n> Whether we want this change or not, I just noticed that the real\n> patch [1/1] has no commit log message, and most of what is in the\n> above \"cover letter\" would would make a good material for the log\n> message.  Perhaps we'd want to redo the log message if it turns out\n> that we want to take this change.\n> \n> […]\n\nThank you very much for your feedback.\n\nI’ve just re-rolled the patch to only move the cover letter to the commit \nmessage in case the patch is eventually accepted.\n\nI proposed this patch because I thought that people picky about colors would \nhave customized them anyway and people less picky about colors would leave the \ndefault and would find smarter to have the same color scheme for different tools \ndoing the same thing (`git grep` and `GNU grep`).\nI choose to align `git grep` on `GNU grep` because the latter has a more \ncolorful scheme and elements already colored in both schemes are already \nsharing the same color.\n\nI however understand your points and I would understand if the patch is \ndropped if it isn’t worth having to justify a change of default values.\n\n\n"}]}