revision traversal: prepare for commit log match.
PATCH 2/3 revision traversal: prepare for commit log match.
This is from a suggestion by Linus, just to mark the locations where we need to modify to actually implement the filtering.
We do not have any actual filtering code yet.
Signed-off-by Junio C Hamano <[email protected]>
--- revision.c | 13 +++++++++++++ revision.h | 4 ++++ 2 files changed, 17 insertions(+), 0 deletions(-)
revision.c +13 -0
@@ -6,6 +6,8 @@ #include "commit.h"#include "diff.h" #include "refs.h" #include "revision.h" +#include <regex.h> +#include "grep.h" static char *path_name (struct name_path *path,const char *name) {
@@ -1026,6 +1028,15 @@ static void mark_boundary_to_show(struct } } +static int commit_match (struct commit *commit,struct rev_info *opt) +{ +if (!opt->header_filter && !opt->message_filter) +return 1 ; + +/* match it here */ +return 1 ; +} +struct commit *get_revision (struct rev_info *revs) {struct commit_list *list = revs->commits;
@@ -1085,6 +1096,8 @@ struct commit *get_revision(struct rev_iif (revs->no_merges && commit->parents && commit->parents->next)continue ; +if (!commit_match (commit, revs)) +continue ;if (revs->prune_fn && revs->dense) {/* Commit without changes? */ if (!(commit->object.flags &TREECHANGE )) {
revision.h +4 -0
@@ -67,6 +67,10 @@ struct rev_info {const char *add_signoff;const char *extra_headers; +/* Filter by commit log message */ +struct grep_opt *header_filter; +struct grep_opt *message_filter; +/* special limits */ int max_count;unsigned long max_age;
Signature · 1 line
1.4.2.1.g414e5