From: Junio C Hamano Date: Wed, 17 May 2006 18:59:34 GMT Subject: Re: [PATCH] builtin-grep: workaround for non GNU grep. Message-ID: <7vodxwcwa1.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > I think this is portable and correct. > > Of course, it still ignores the fact that not all grep's support some of > the flags like -F/-L/-A/-C etc, but for those cases, the external grep > itself will happily just say "unrecognized option -F" or similar. > > So with this change, "git grep" should handle all the flags the native > grep handles, which is really quite fine. We don't _need_ to expose > anything more, and if you do want our extensions, you can get them with > "--uncached" and an up-to-date index. > > No configuration necessary, and we automatically take advantage of any > native grep we have, if possible. This makes -c misbehave in a subtle way. git grep -c -e no-such-string-anywhere | head -n 1 But I do not think we care.