Re: [PATCH] git-grep: Add ability to limit directory recursion
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- May 7, 2008, 01:34 UTC
- Message-ID
- <200805070334.18500.jnareb@gmail.com>
- In-Reply-To
- <20080507004719.GJ18081@yugib.highrise.ca>
Aidan Van Dyk wrote:
Show 16 quoted lines
> * Jakub Narebski <jnareb@gmail.com> [080506 20:34]: >> Aidan Van Dyk <aidan@highrise.ca> writes: >> >>> This add a -R <limit> option to git-grep which will limit the depth of the >>> directories recursed when git is doing a grep. >>> >>> This allows you to do something like: >>> git grep -R 1 <pattern> >>> and see only the results of the grep on files in the current directory. >>> >>> It defaults to a limit of "0" which disables the limiting. >> >> Nice idea, although I'm not sure if we shouldn't borrow "-maxdepth" >> option from GNU find and friends... > > Good idea - I hadn't thought of that, but I like it better.
Note that GNU find uses non-standard single-dash long options, and that "-maxdepth 0" means do not recurse, but use only files provided as arguments.
GNU wget on the other hand uses -l DEPTH/--level=DEPTH, and uses -l 0 (or -l inf) as in your patch, i.e. infinite recursion.
-- Jakub Narebski Poland