Re: [PATCH] grep --no-index: allow use of "git grep" outside a git repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 16, 2010, 01:05 UTC
- Message-ID
- <7vwrzin9jt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20100115210854.GA21540@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> On Fri, Jan 15, 2010 at 12:52:40PM -0800, Junio C Hamano wrote: > >> Just like some people wanted diff features that are not found in >> other people's diff implementations outside of a git repository >> and added --no-index mode to the command, this adds --no-index mode >> to the "git grep" command. > > Out of curiosity, what are the interesting features in git grep versus > other greps?
Three examples:
git grep -e Junio --and -e Dscho --and -e Peff
is different from
grep "Junio.*Dscho.*Peff"
in that the latter wouldn't find a line that has these names in different order. You can of course give permutations explicitly, like
grep -e "Junio.*Dscho.*Peff" \
-e "Dscho.*Junio.*Peff" \
...
-e "Peff.*Dscho.*Junio"I don't know how you would do these with "grep":
git grep -e Junio --and -e Dscho --and --not -e Linus
git grep --all-match -e Junio -e Dscho