From 0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 27 Sep 2006 17:50:52 -0700 Subject: 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 --- builtin-grep.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'builtin-grep.c') diff --git a/builtin-grep.c b/builtin-grep.c index 4205e5d38d..ad7dc00cde 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], -- cgit v1.2.1