author | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 May 2011 01:48:36 +0000 (18:48 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 May 2011 05:53:16 +0000 (22:53 -0700) | ||
commit | cca2c172e0c37eff8e743b63016b6bc604b38a7d | |
tree | cd8b503515da895d7f620b85ad59e8a59ecf4c73 | tree | snapshot |
parent | 258a6188496fe5131203905b6cd596af69312247 | commit | diff |
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>
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 | diff | blob | history |