diff options
author | J Smith <dark.panda@gmail.com> | 2012-08-03 10:53:50 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-08-03 09:58:02 -0700 |
commit | 84befcd0a4a074e2ae191c32be09d2e82d5db114 (patch) | |
tree | c33fa66c5a950c3fc572a87167a1b0d4b1cc9036 /grep.h | |
parent | 0e4c8822e98e27c3c63125570c8bcbf0a8fd34da (diff) | |
download | git-84befcd0a4a074e2ae191c32be09d2e82d5db114.tar.gz |
grep: add a grep.patternType configuration setting
The grep.extendedRegexp configuration setting enables the -E flag on grep
by default but there are no equivalents for the -G, -F and -P flags.
Rather than adding an additional setting for grep.fooRegexp for current
and future pattern matching options, add a grep.patternType setting that
can accept appropriate values for modifying the default grep pattern
matching behavior. The current values are "basic", "extended", "fixed",
"perl" and "default" for setting -G, -E, -F, -P and the default behavior
respectively.
When grep.patternType is set to a value other than "default", the
grep.extendedRegexp setting is ignored. The value of "default" restores
the current default behavior, including the grep.extendedRegexp
behavior.
Signed-off-by: J Smith <dark.panda@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
-rw-r--r-- | grep.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -58,6 +58,14 @@ enum grep_expr_node { GREP_NODE_OR }; +enum grep_pattern_type { + GREP_PATTERN_TYPE_UNSPECIFIED = 0, + GREP_PATTERN_TYPE_BRE, + GREP_PATTERN_TYPE_ERE, + GREP_PATTERN_TYPE_FIXED, + GREP_PATTERN_TYPE_PCRE +}; + struct grep_expr { enum grep_expr_node node; unsigned hit; @@ -103,6 +111,8 @@ struct grep_opt { int max_depth; int funcname; int funcbody; + int extended_regexp_option; + int pattern_type_option; char color_context[COLOR_MAXLEN]; char color_filename[COLOR_MAXLEN]; char color_function[COLOR_MAXLEN]; |