Skip to content

Commit 8c69c1f

Browse files
pcloudsgitster
authored andcommitted
Document limited recursion pathspec matching with wildcards
It's actually unlimited recursion if wildcards are active regardless --max-depth Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6db5c6e commit 8c69c1f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Documentation/git-grep.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ OPTIONS
7979
--max-depth <depth>::
8080
For each <pathspec> given on command line, descend at most <depth>
8181
levels of directories. A negative value means no limit.
82+
This option is ignored if <pathspec> contains active wildcards.
83+
In other words if "a*" matches a directory named "a*",
84+
"*" is matched literally so --max-depth is still effective.
8285

8386
-w::
8487
--word-regexp::

tree-walk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,9 @@ enum interesting tree_entry_interesting(const struct name_entry *entry,
661661
/*
662662
* Match all directories. We'll try to match files
663663
* later on.
664+
* max_depth is ignored but we may consider support it
665+
* in future, see
666+
* http://thread.gmane.org/gmane.comp.version-control.git/163757/focus=163840
664667
*/
665668
if (ps->recursive && S_ISDIR(entry->mode))
666669
return entry_interesting;

0 commit comments

Comments
 (0)