diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-06 01:01:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-06 01:01:30 +0300 |
commit | 2043ce828e8020778c5460eaf7d5a207317c1c09 (patch) | |
tree | 51a85e0b9679bceb8fa2dfbae89d163e4884e28b /revision.c | |
parent | 2a6c7f996e85aab2173a378349e8c0d952755686 (diff) | |
parent | 794c000267b7bd29024b56e282509a82b31e6fc8 (diff) |
Merge branch 'rs/log-invert-grep-with-headers'
"git log --invert-grep --author=<name>" used to exclude commits
written by the given author, but now "--invert-grep" only affects
the matches made by the "--grep=<pattern>" option.
* rs/log-invert-grep-with-headers:
log: let --invert-grep only invert --grep
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/revision.c b/revision.c index 5390a479b3..250f61e8cf 100644 --- a/revision.c +++ b/revision.c @@ -2498,7 +2498,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg } else if (!strcmp(arg, "--all-match")) { revs->grep_filter.all_match = 1; } else if (!strcmp(arg, "--invert-grep")) { - revs->invert_grep = 1; + revs->grep_filter.no_body_match = 1; } else if ((argcount = parse_long_opt("encoding", argv, &optarg))) { if (strcmp(optarg, "none")) git_log_output_encoding = xstrdup(optarg); @@ -3783,7 +3783,7 @@ static int commit_match(struct commit *commit, struct rev_info *opt) (char *)message, strlen(message)); strbuf_release(&buf); unuse_commit_buffer(commit, message); - return opt->invert_grep ? !retval : retval; + return retval; } static inline int want_ancestry(const struct rev_info *revs) |