Code

git-grep: Bail out when -P is used with -F or -E
authorMichał Kiedrowicz <michal.kiedrowicz@gmail.com>
Mon, 9 May 2011 21:52:08 +0000 (23:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2011 23:29:55 +0000 (16:29 -0700)
commit258a6188496fe5131203905b6cd596af69312247
treefee161aea408ef5664189db041cc89ae509b1353
parent8f852ce613650b0cccf02adecbc18865d8e21fb6
git-grep: Bail out when -P is used with -F or -E

This patch makes git-grep die() when -P is used on command line together
with -E/--extended-regexp or -F/--fixed-strings.

This also makes it bail out when grep.extendedRegexp is enabled.

But `git grep -G -P pattern` and `git grep -E -G -P pattern` still work
because -G and -E set opts.regflags during parse_options() and there is
no way to detect `-G` or `-E -G`.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c
t/t7810-grep.sh