Re: git grep -F doesn't behave like grep -F?
- From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
- Date
- May 18, 2012, 12:37 UTC
- Message-ID
- <4FB6426C.7040202@lsrfire.ath.cx>
- In-Reply-To
- <CAEV-rjc0PtuQZei95_24=Ou=mZZxA0Lsr6boXGrGy3z40otkNQ@mail.gmail.com>
Am 18.05.2012 13:00, schrieb Torne (Richard Coles):
Show 14 quoted lines
> Hi folks, > > git grep -F is documented as: "Use fixed strings for patterns (don’t > interpret pattern as a regex)." > > whereas grep -F is documented as "Interpret PATTERN as a list of > fixed strings, separated by newlines, any of which is to be > matched." > > This accurately describes how they behave, which means that git grep > -F with a pattern containing newlines never matches anything (at least > as far as I can see). Is this intentional, or an oversight? The > ability to grep -F for a list (e.g. the output of another grep) is > pretty handy...
You could use -f- (read patterns from stdin).
That said, it looks like a missing feature to me -- at least I didn't know that grep -F takes newline separated lists of search strings. And this doesn't seem to be restricted to invocations with -F, only; a plain grep with regexps does it as well.
René