summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2015-01-03 22:27:48 -0700
committerJunio C Hamano <gitster@pobox.com>2015-01-06 14:40:46 -0800
commita462402232aab7f44c46c614ac9c3d94c65b3831 (patch)
tree85a07d33076d743a7767f8524cd5eaddf74e9577 /grep.c
parentc2e8e4b9da4d007b15faa2e3d407b2fd279f0572 (diff)
downloadgit-cj/grep-none-match.tar.gz
git-log: added --none-match optioncj/grep-none-match
Implements a inverted match for "git log", like in the case of "git grep -v", which is useful from time to time to e.g. filter FIXUP message out of "git log". Internally, a new bol 'none_match' has been introduces as revs->grep_filter.invert inverts the match line-wise, which cannot work as i.e. empty line always not match the pattern given. Signed-off-by: Christoph Junghans <ottxor@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/grep.c b/grep.c
index 6e085f8297..f486ee5631 100644
--- a/grep.c
+++ b/grep.c
@@ -1622,6 +1622,8 @@ static int chk_hit_marker(struct grep_expr *x)
int grep_source(struct grep_opt *opt, struct grep_source *gs)
{
+ if(opt->none_match)
+ return !grep_source_1(opt, gs, 0);
/*
* we do not have to do the two-pass grep when we do not check
* buffer-wide "all-match".