summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Andreas Schwab <schwab@linux-m68k.org>2014-03-17 20:16:05 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-03-20 12:38:00 -0700
commit6453f7b34864c1a639cc367f576476ee3be1456f (patch)
tree4df12bd5d677db271094c0676d228cdacc155665
parentUpdate draft release notes to Git 2.0 (diff)
downloadtgif-6453f7b34864c1a639cc367f576476ee3be1456f.tar.xz
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>
-rw-r--r--Documentation/git-grep.txt3
-rw-r--r--grep.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index f83733490f..31811f16bd 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -53,6 +53,9 @@ grep.extendedRegexp::
option is ignored when the 'grep.patternType' option is set to a value
other than 'default'.
+grep.fullName::
+ If set to true, enable '--full-name' option by default.
+
OPTIONS
-------
diff --git a/grep.c b/grep.c
index c668034739..ece04bf275 100644
--- a/grep.c
+++ b/grep.c
@@ -86,6 +86,11 @@ int grep_config(const char *var, const char *value, void *cb)
return 0;
}
+ if (!strcmp(var, "grep.fullname")) {
+ opt->relative = !git_config_bool(var, value);
+ return 0;
+ }
+
if (!strcmp(var, "color.grep"))
opt->color = git_config_colorbool(var, value);
else if (!strcmp(var, "color.grep.context"))