From: Michał Kiedrowicz Date: Fri, 10 Jul 2009 16:48:28 GMT Subject: Re: [PATCH/RFC] grep: Add --directories option. Message-ID: <20090710184828.63d123d0@gmail.com> In-Reply-To: <7vmy7dufdp.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > René Scharfe 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