aboutsummaryrefslogtreecommitdiff
path: root/builtin-grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-27 17:50:52 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-27 23:59:09 -0700
commit0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92 (patch)
treee72f754dde2eb05fa8da2c1acfbcf5b03cbdc5e9 /builtin-grep.c
parent2d5b459107cf07bbb307cfb196c2007c497a6dd2 (diff)
downloadgit-0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92.tar.gz
git-0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92.tar.xz
grep --all-match
This lets you say: git grep --all-match -e A -e B -e C to find lines that match A or B or C but limit the matches from the files that have all of A, B and C. This is different from git grep -e A --and -e B --and -e C in that the latter looks for a single line that has all of these at the same time. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 4205e5d38..ad7dc00cd 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -596,6 +596,10 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
GREP_CLOSE_PAREN);
continue;
}
+ if (!strcmp("--all-match", arg)) {
+ opt.all_match = 1;
+ continue;
+ }
if (!strcmp("-e", arg)) {
if (1 < argc) {
append_grep_pattern(&opt, argv[1],