Subject: Re: [PATCH] grep: --full-tree

From: Uri Okrent <[email-masked]>
Date: Sun, 29 Nov 2009 11:50:50 -0800

Jeff King wrote:
> On Fri, Nov 27, 2009 at 10:47:45AM -0800, Uri Okrent wrote:
>> As a matter of
>> fact, my personal opinion (which I probably neglected to mention) is
>> that grep default behavior should stay the same since it is semantically
>> closer to unix (or gnu) grep.
> 
> Keeping consistency with non-git grep has been mentioned a few times in
> this thread.  I really don't understand how default file selection is
> supposed to maintain consistency with non-git grep. Regular grep
> defaults to stdin if no paths are given. That mode doesn't make any
> sense for git grep.
> 
> So of the two options (grepping the list of files from the full tree, or
> the list of files rooted at the current directory), how is one closer to
> non-git grep than the other?
> 
> -Peff

I guess you're right, in that neither is exactly the same as non-git,
and so it's impossible to objectively quantify how one is "closer". My
general feeling though is that grep rooted at the current directory is
more similar because grep -r does exist and is common enough that the
layman isn't too surprised at git's default behavior. Git grep with
--full-tree though, has no analogue in non-git grep.

-- 
    Uri

Please consider the environment before printing this message.
http://www.panda.org/how_you_can_help/