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>
Junio C Hamano committed
Sep 27, 2006 at 17:55 UTC
70d0afba914ddcf8c8a0144e5c6519d43d641dd9
1 file changed
+8
-1
revision.c
+8
-1
@@ -732,6 +732,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
732
int i, flags, seen_dashdash, show_merge;
733
const char **unrecognized = argv + 1;
734
int left = 1;
735
+ int all_match = 0;
736
737
/* First, search for "--" */
738
seen_dashdash = 0;
@@ -967,6 +968,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
968
add_message_grep(revs, arg+7);
969
continue;
970
}
971
+ if (!strcmp(arg, "--all-match")) {
972
+ all_match = 1;
973
+ continue;
974
+ }
975
976
opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i);
977
if (opts > 0) {
@@ -1028,8 +1033,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
1033
if (diff_setup_done(&revs->diffopt) < 0)
1034
die("diff_setup_done failed");
1035
1031
- if (revs->grep_filter)
1036
+ if (revs->grep_filter) {
1037
+ revs->grep_filter->all_match = all_match;
1038
compile_grep_patterns(revs->grep_filter);
1039
+ }
1040
1041
return left;
1042
}