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
This commit is contained in:
@ -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 },
|
||||
|
Reference in New Issue
Block a user