Skip to content

Commit fe3420b

Browse files
marcowsgitster
authored andcommitted
grep: don't support "grep.color"-like config options
color.grep and color.grep.* is the official and documented way to highlight grep matches. Comparable options like diff.color.* and status.color.* exist for backward compatibility reasons only and are not documented any more. Signed-off-by: Markus Heidelberg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 680ebc0 commit fe3420b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

builtin-grep.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@ static int grep_config(const char *var, const char *value, void *cb)
2626
{
2727
struct grep_opt *opt = cb;
2828

29-
if (!strcmp(var, "grep.color") || !strcmp(var, "color.grep")) {
29+
if (!strcmp(var, "color.grep")) {
3030
opt->color = git_config_colorbool(var, value, -1);
3131
return 0;
3232
}
33-
if (!strcmp(var, "grep.color.external") ||
34-
!strcmp(var, "color.grep.external")) {
33+
if (!strcmp(var, "color.grep.external"))
3534
return git_config_string(&(opt->color_external), var, value);
36-
}
37-
if (!strcmp(var, "grep.color.match") ||
38-
!strcmp(var, "color.grep.match")) {
35+
if (!strcmp(var, "color.grep.match")) {
3936
if (!value)
4037
return config_error_nonbool(var);
4138
color_parse(value, var, opt->color_match);

0 commit comments

Comments
 (0)