Re: [PATCH] builtin-grep: workaround for non GNU grep.
Linus Torvalds <torvalds@osdl.org> writes:
Show 13 quoted lines
> 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.