request: add git grep -o option
- From
Joe Perches <joe@perches.com>
- Date
- Oct 30, 2019, 19:58 UTC
- Message-ID
- <277ee7531df8dfd3249f189b9b298a5d187ec479.camel@perches.com>
Instead of duplicating a grep pattern with grep -oh after git grep like this:
$ git grep -P '(?:[a-z0-9_]+_)?for_each(?:_[a-z0-9_]+)?' -- '*.[ch]' | \ grep -P -oh '(?:[a-z0-9_]+_)?for_each(?:_[a-z0-9_]+)?'
it could be useful to have git grep have the same '-o' option as gnu grep.