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

From: Michał Kiedrowicz <[email-masked]>
Date: Fri, 10 Jul 2009 18:48:28 +0200

Junio C Hamano <[email-masked]> wrote:

> René Scharfe <[email-masked]> 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