Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-19 07:34:05 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-19 07:34:06 +0300
commit9822b8f10d2c255c3bda81aa800fa056549f034a (patch)
tree85959ab31de49c7360745b67f14694a9a97ed2fd /builtin
parent54e564e1d626fbcfb5eabddaccc9daf0aae6a9be (diff)
parent0a09e5edc281941b77dbf7aa3436781250d16088 (diff)
Merge branch 'rs/grep-no-recursive'
Unlike "grep", "git grep" by default recurses to the whole tree. The command learned "git grep --recursive" option, so that "git grep --no-recursive" can serve as a synonym to setting the max-depth to 0. * rs/grep-no-recursive: grep: add -r/--[no-]recursive
Diffstat (limited to 'builtin')
-rw-r--r--builtin/grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 0c3527242e..d8508ddf79 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -812,6 +812,8 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
GREP_BINARY_NOMATCH),
OPT_BOOL(0, "textconv", &opt.allow_textconv,
N_("process binary files with textconv filters")),
+ OPT_SET_INT('r', "recursive", &opt.max_depth,
+ N_("search in subdirectories (default)"), -1),
{ OPTION_INTEGER, 0, "max-depth", &opt.max_depth, N_("depth"),
N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
NULL, 1 },