git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Michał Kiedrowicz
Message 4 of 4 in “grep: Add --max-depth option.”
  1. grep: Add --max-depth option.Michał Kiedrowicz, Jul 21, 2009
  2. Stephen BoydJul 22, 2009
  3. Michał KiedrowiczJul 22, 2009
  4. Junio C HamanoJul 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.