aboutsummaryrefslogtreecommitdiffstats
path: root/grep.h
diff options
context:
space:
mode:
authorJ Smith <dark.panda@gmail.com>2012-08-03 10:53:50 -0400
committerJunio C Hamano <gitster@pobox.com>2012-08-03 09:58:02 -0700
commit84befcd0a4a074e2ae191c32be09d2e82d5db114 (patch)
treec33fa66c5a950c3fc572a87167a1b0d4b1cc9036 /grep.h
parent0e4c8822e98e27c3c63125570c8bcbf0a8fd34da (diff)
downloadgit-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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/grep.h b/grep.h
index ed7de6bec8..75afb7b105 100644
--- a/grep.h
+++ b/grep.h
@@ -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];