Skip to content

Commit

Permalink
Document limited recursion pathspec matching with wildcards
Browse files Browse the repository at this point in the history
It's actually unlimited recursion if wildcards are active regardless
--max-depth

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jan 15, 2012
1 parent 6db5c6e commit 8c69c1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Documentation/git-grep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

-w::
--word-regexp::
Expand Down
3 changes: 3 additions & 0 deletions tree-walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* http://thread.gmane.org/gmane.comp.version-control.git/163757/focus=163840
*/
if (ps->recursive && S_ISDIR(entry->mode))
return entry_interesting;
Expand Down

0 comments on commit 8c69c1f

Please sign in to comment.