summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-28 00:55:58 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-09-28 06:59:10 (GMT)
commit70d0afba914ddcf8c8a0144e5c6519d43d641dd9 (patch)
treea1c1f18163306a6c320197f92ec3e0f601a7e474 /revision.c
parent0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92 (diff)
downloadgit-70d0afba914ddcf8c8a0144e5c6519d43d641dd9.zip
git-70d0afba914ddcf8c8a0144e5c6519d43d641dd9.tar.gz
git-70d0afba914ddcf8c8a0144e5c6519d43d641dd9.tar.bz2
teach revision walker about --all-match.
This lets you say: git log --all-match --author=Linus --committer=Junio --grep=rev-list to limit commits that was written by Linus, committed by me and the log message contains word "rev-list". Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/revision.c b/revision.c
index 93f2513..f1e0caa 100644
--- a/revision.c
+++ b/revision.c
@@ -732,6 +732,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
int i, flags, seen_dashdash, show_merge;
const char **unrecognized = argv + 1;
int left = 1;
+ int all_match = 0;
/* First, search for "--" */
seen_dashdash = 0;
@@ -967,6 +968,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
add_message_grep(revs, arg+7);
continue;
}
+ if (!strcmp(arg, "--all-match")) {
+ all_match = 1;
+ continue;
+ }
opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
if (opts > 0) {
@@ -1028,8 +1033,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
if (diff_setup_done(&revs->diffopt) < 0)
die("diff_setup_done failed");
- if (revs->grep_filter)
+ if (revs->grep_filter) {
+ revs->grep_filter->all_match = all_match;
compile_grep_patterns(revs->grep_filter);
+ }
return left;
}