From ecd9ba61778e436dde12f08781a12ad1149d5ebf Mon Sep 17 00:00:00 2001 From: Thomas Gummerer Date: Tue, 12 Jan 2016 11:40:26 +0100 Subject: builtin/grep: add grep.fallbackToNoIndex config Currently when git grep is used outside of a git repository without the --no-index option git simply dies. For convenience, add a grep.fallbackToNoIndex configuration variable. If set to true, git grep behaves like git grep --no-index if it is run outside of a git repository. It defaults to false, preserving the current behavior. Helped-by: Jeff King Helped-by: Eric Sunshine Signed-off-by: Thomas Gummerer Signed-off-by: Junio C Hamano --- Documentation/config.txt | 4 ++++ Documentation/git-grep.txt | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'Documentation') diff --git a/Documentation/config.txt b/Documentation/config.txt index 2e919f0df8..d41b2a61a8 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1399,6 +1399,10 @@ grep.extendedRegexp:: option is ignored when the 'grep.patternType' option is set to a value other than 'default'. +grep.fallbackToNoIndex:: + If set to true, fall back to git grep --no-index if git grep + is executed outside of a git repository. Defaults to false. + gpg.program:: Use this custom program instead of "gpg" found on $PATH when making or verifying a PGP signature. The program must support the diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 31811f16bd..1090ebcd2a 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -56,6 +56,10 @@ grep.extendedRegexp:: grep.fullName:: If set to true, enable '--full-name' option by default. +grep.fallbackToNoIndex:: + If set to true, fall back to git grep --no-index if git grep + is executed outside of a git repository. Defaults to false. + OPTIONS ------- -- cgit v1.2.3