Browse files

Document limited recursion pathspec matching with wildcards

It's actually unlimited recursion if wildcards are active regardless

Signed-off-by: Nguyễn Thái Ngọc Duy <>
Signed-off-by: Junio C Hamano <>
  • Loading branch information...
pclouds authored and gitster committed Jan 14, 2012
1 parent 6db5c6e commit 8c69c1f92eb79a597225814781fdf1ab4be26758
Showing with 6 additions and 0 deletions.
  1. +3 −0 Documentation/git-grep.txt
  2. +3 −0 tree-walk.c
@@ -79,6 +79,9 @@ OPTIONS
--max-depth <depth>::
For each <pathspec> given on command line, descend at most <depth>
levels of directories. A negative value means no limit.
This option is ignored if <pathspec> contains active wildcards.
In other words if "a*" matches a directory named "a*",
"*" is matched literally so --max-depth is still effective.
@@ -661,6 +661,9 @@ enum interesting tree_entry_interesting(const struct name_entry *entry,
* Match all directories. We'll try to match files
* later on.
* max_depth is ignored but we may consider support it
* in future, see
if (ps->recursive && S_ISDIR(entry->mode))
return entry_interesting;

0 comments on commit 8c69c1f

Please sign in to comment.