git-rev-list: Add regexp tuning options
This patch introduces --extended-regexp and --regexp-ignore-case options to tune what kind of patterns the pattern-limiting options (--grep, --author, ...) accept. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
77e4e8bd9b
commit
93d496a560
12
revision.c
12
revision.c
@ -881,6 +881,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
|
||||
const char **unrecognized = argv + 1;
|
||||
int left = 1;
|
||||
int all_match = 0;
|
||||
int regflags = 0;
|
||||
|
||||
/* First, search for "--" */
|
||||
seen_dashdash = 0;
|
||||
@ -1152,6 +1153,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
|
||||
add_message_grep(revs, arg+7);
|
||||
continue;
|
||||
}
|
||||
if (!prefixcmp(arg, "--extended-regexp")) {
|
||||
regflags |= REG_EXTENDED;
|
||||
continue;
|
||||
}
|
||||
if (!prefixcmp(arg, "--regexp-ignore-case")) {
|
||||
regflags |= REG_ICASE;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--all-match")) {
|
||||
all_match = 1;
|
||||
continue;
|
||||
@ -1200,6 +1209,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
|
||||
}
|
||||
}
|
||||
|
||||
if (revs->grep_filter)
|
||||
revs->grep_filter->regflags |= regflags;
|
||||
|
||||
if (show_merge)
|
||||
prepare_show_merge(revs);
|
||||
if (def && !revs->pending.nr) {
|
||||
|
Reference in New Issue
Block a user