grep: add -r/--[no-]recursive
commit0a09e5edc281941b77dbf7aa3436781250d16088
authorRené Scharfe <l.s.r@web.de>
Mon, 1 Oct 2018 19:15:57 +0000 (1 21:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Oct 2018 04:25:57 +0000 (3 21:25 -0700)
tree7a40830ed88b1973e36ff2be353987ffe31b83bb
parentfe8321ec057f9231c26c29b364721568e58040f7
grep: add -r/--[no-]recursive

Recognize -r and --recursive as synonyms for --max-depth=-1 for
compatibility with GNU grep; it's still the default for git grep.

This also adds --no-recursive as synonym for --max-depth=0 for free,
which is welcome for completeness and consistency.

Fix the description for --max-depth, while we're at it -- negative
values other than -1 actually disable recursion, i.e. they are
equivalent to --max-depth=0.

Requested-by: Christoph Berg <myon@debian.org>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Initial-patch-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-grep.txt
builtin/grep.c
t/t7810-grep.sh