grep: add grep.fullName config variable
This configuration variable sets the default for the --full-name option. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Andreas Schwab committed
Mar 17, 2014 at 20:16 UTC
6453f7b34864c1a639cc367f576476ee3be1456f
2 files changed
+8
Documentation/git-grep.txt
+3
@@ -53,6 +53,9 @@ grep.extendedRegexp::
53
option is ignored when the 'grep.patternType' option is set to a value
54
other than 'default'.
55
56
+grep.fullName::
57
+ If set to true, enable '--full-name' option by default.
58
+
59
60
OPTIONS
61
-------
grep.c
+5
@@ -86,6 +86,11 @@ int grep_config(const char *var, const char *value, void *cb)
86
return 0;
87
}
88
89
+ if (!strcmp(var, "grep.fullname")) {
90
+ opt->relative = !git_config_bool(var, value);
91
+ return 0;
92
+ }
93
+
94
if (!strcmp(var, "color.grep"))
95
opt->color = git_config_colorbool(var, value);
96
else if (!strcmp(var, "color.grep.context"))