From: Junio C Hamano Date: Sat, 16 Jan 2010 01:05:42 GMT Subject: Re: [PATCH] grep --no-index: allow use of "git grep" outside a git repository Message-ID: <7vwrzin9jt.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100115210854.GA21540@coredump.intra.peff.net> Jeff King writes: > 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