Skip to content

Commit

Permalink
grep: add grep.fullName config variable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Schwab authored and Junio C Hamano committed Mar 20, 2014
1 parent 00eda23 commit 6453f7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Documentation/git-grep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down
5 changes: 5 additions & 0 deletions grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 6453f7b

Please sign in to comment.