git-grep: do not die upon -F/-P when grep.extendedRegexp is set.
commitcca2c172e0c37eff8e743b63016b6bc604b38a7d
authorJunio C Hamano <gitster@pobox.com>
Tue, 10 May 2011 01:48:36 +0000 (9 18:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 May 2011 05:53:16 +0000 (9 22:53 -0700)
treecd8b503515da895d7f620b85ad59e8a59ecf4c73
parent258a6188496fe5131203905b6cd596af69312247
git-grep: do not die upon -F/-P when grep.extendedRegexp is set.

The previous one made "git grep -P" fail when grep.extendedRegexp is
enabled.  That is a no-starter.  The option on the command line should
just make the command ignore the configured default.  The handling of "-F"
in the existing code has the same problem.

Instead of saying -G/-F/-E/-P incompatible with each other, just allow
the last one win.  That way, you can have "[alias] gr = grep -P" and
use Pcre for everyday work e.g. "git gr ':i?foo'", and append -G to the
aliased command line to override it e.g. "git gr -G '[Ff][Oo][Oo]'".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c