Re: [PATCH] grep: --full-tree
- From
Uri Okrent <uokrent@gmail.com>
- Date
- Nov 29, 2009, 19:50 UTC
- Message-ID
- <4B12D09A.3080408@gmail.com>
- In-Reply-To
- <20091127205305.GB26921@coredump.intra.peff.net>
Jeff King wrote:
Show 17 quoted lines
> 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/