Re: [PATCH] builtin-grep: workaround for non GNU grep.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxx> 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.


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]