Re: [PATCH v3] grep: Add --max-depth option.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 22, 2009, 17:08 UTC
- Message-ID
- <7veis8myqr.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4A66BB64.5070106@gmail.com>
Thanks for a review. With the suggested changes the patch looks better.
I had to wonder what would happen when you give an input like this, though:
$ git grep --max-depth=1 t Documentation/howto
If you look at the way the loop in pathspec_matches() is structured, it becomes clear that the depth limit is applied independently to each of the pathspecs given on the command line, and re-reading the description of the option in the documentation _with_ that knowledge it becomes obvious what should happen, but I couldn't figure it out before looking at the code. Perhaps the documentation needs a bit more verbosity? I dunno.