mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
log: let --invert-grep only invert --grep
The option --invert-grep is documented to filter out commits whose messages match the --grep filters. However, it also affects the header matches (--author, --committer), which is not intended. Move the handling of that option to grep.c, as only the code there can distinguish between matches in the header from those in the message body. If --invert-grep is given then enable extended expressions (not the regex type, we just need git grep's --not to work), negate the body patterns and check if any of them match by piggy-backing on the collect_hits mechanism of grep_source_1(). Collecting the matches in struct grep_opt is a bit iffy, but with "last_shown" we have a precedent for writing state information to that struct. Reported-by: Dotan Cohen <dotancohen@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e9d7761bb9
commit
794c000267
@@ -246,8 +246,6 @@ struct rev_info {
|
||||
|
||||
/* Filter by commit log message */
|
||||
struct grep_opt grep_filter;
|
||||
/* Negate the match of grep_filter */
|
||||
int invert_grep;
|
||||
|
||||
/* Display history graph */
|
||||
struct git_graph *graph;
|
||||
|
||||
Reference in New Issue
Block a user