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

Re: [PATCH/RFC] grep: Add --directories option.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2009, 08:11 UTC
Message-ID
<7vmy7dufdp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4A56EED7.9040008@lsrfire.ath.cx>
René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> It seems your patch still allows recursion, one level deep.
I suspect what the patch wants to do may be fundamentally unworkable.

Unlike GNU grep that takes its command line arguments literally as files and directories, we use them merely as pathspec filters, so...

> 	$ git grep -l --directories=skip GNU compat/*

... while I think you should be able to compensate for this kind of "off-by-one" and make it appear to work, I do not think there is a good definition of which level it should stop if you run it with something like this (notice the single-quote around the pathspec to prevent it from getting expanded by the shell):

	git grep GNU 'compat/*/*'
Previous: René ScharfeNext: Michał Kiedrowicz
Message 3 of 6 in “grep: Add --directories option.”
  1. grep: Add --directories option.Michał Kiedrowicz, Jul 9, 2009
  2. René ScharfeJul 10, 2009
  3. Junio C HamanoJul 10, 2009
  4. Michał KiedrowiczJul 10, 2009
  5. Michał KiedrowiczJul 10, 2009
  6. Stephen BoydJul 10, 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.