Browse Source

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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Nguyễn Thái Ngọc Duy 13 years ago committed by Junio C Hamano
parent
commit
8c69c1f92e
  1. 3
      Documentation/git-grep.txt
  2. 3
      tree-walk.c

3
Documentation/git-grep.txt

@ -79,6 +79,9 @@ OPTIONS @@ -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::

3
tree-walk.c

@ -661,6 +661,9 @@ match_wildcards: @@ -661,6 +661,9 @@ match_wildcards:
/*
* 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;

Loading…
Cancel
Save