summaryrefslogtreecommitdiff
path: root/builtin-grep.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-28 00:50:52 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-09-28 06:59:09 (GMT)
commit0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92 (patch)
treee72f754dde2eb05fa8da2c1acfbcf5b03cbdc5e9 /builtin-grep.c
parent2d5b459107cf07bbb307cfb196c2007c497a6dd2 (diff)
downloadgit-0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92.zip
git-0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92.tar.gz
git-0ab7befa31d07fe3ffb51a6cc626d4c09ded1c92.tar.bz2
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 4205e5d..ad7dc00 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],