diff options
author | Lénaïc Huard <lenaic@lhuard.fr> | 2022-01-05 09:18:35 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-05 12:42:54 -0800 |
commit | b83f99c3990cc9080ec8f5459555069d47e4cdfb (patch) | |
tree | e4f73bf07bd96454dab7453d30549442f05a5468 | |
parent | The third batch (diff) | |
download | tgif-b83f99c3990cc9080ec8f5459555069d47e4cdfb.tar.xz |
grep: align default colors with GNU grep ones
git-grep shares a lot of options with the standard grep tool.
Like GNU grep, it has coloring options to highlight the matching text.
And like it, it has options to customize the various colored parts.
This patch updates the default git-grep colors to make them match the
GNU grep default ones [1].
It was possible to get the same result by setting the various `color.grep.<slot>`
options, but this patch makes `git grep --color` share the same color scheme as
`grep --color` by default without any user configuration.
[1] https://www.man7.org/linux/man-pages/man1/grep.1.html#ENVIRONMENT
Signed-off-by: Lénaïc Huard <lenaic@lhuard.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | grep.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -26,10 +26,10 @@ static struct grep_opt grep_defaults = { .pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED, .colors = { [GREP_COLOR_CONTEXT] = "", - [GREP_COLOR_FILENAME] = "", + [GREP_COLOR_FILENAME] = GIT_COLOR_MAGENTA, [GREP_COLOR_FUNCTION] = "", - [GREP_COLOR_LINENO] = "", - [GREP_COLOR_COLUMNNO] = "", + [GREP_COLOR_LINENO] = GIT_COLOR_GREEN, + [GREP_COLOR_COLUMNNO] = GIT_COLOR_GREEN, [GREP_COLOR_MATCH_CONTEXT] = GIT_COLOR_BOLD_RED, [GREP_COLOR_MATCH_SELECTED] = GIT_COLOR_BOLD_RED, [GREP_COLOR_SELECTED] = "", |