aboutsummaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-17 15:43:40 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-20 11:14:39 -0700
commit8ecae9b032cd0427079d557a3bb6c39116420d4b (patch)
tree1ebfe8b2754c1b8929432791ceb521fc73437ef0 /revision.c
parent83b5d2f5b0c95fe102bc3d1cc2947abbdf5e5c5b (diff)
downloadgit-8ecae9b032cd0427079d557a3bb6c39116420d4b.tar.gz
git-8ecae9b032cd0427079d557a3bb6c39116420d4b.tar.xz
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 <junkio@cox.net>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index 6a2539b62..a14457a12 100644
--- a/revision.c
+++ b/revision.c
@@ -6,6 +6,8 @@
#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)
{
@@ -1045,6 +1047,15 @@ static void mark_boundary_to_show(struct commit *commit)
}
}
+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;
@@ -1105,6 +1116,8 @@ struct commit *get_revision(struct rev_info *revs)
if (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)) {