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

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

From
Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Date
Jul 10, 2009, 16:48 UTC
Message-ID
<20090710184828.63d123d0@gmail.com>
In-Reply-To
<7vmy7dufdp.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> 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/*/*'
> 

To makes things simplier (but maybe not correct) I assumed that '*' matches _any_ string, including '/', so any file in "compat/" (even in subdirs) should be treated as a file specified on command line.

Michał Kiedrowicz
Previous: Junio C HamanoNext: Michał Kiedrowicz
Message 4 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.