Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org, Kai Blin <kai.blin@gmail.com>,
	Jeff King <peff@peff.net>
Subject: [PATCH 2/3] revision traversal: prepare for commit log match.
Date: Sun, 17 Sep 2006 17:42:25 -0700	[thread overview]
Message-ID: <7vac4yyphq.fsf@assigned-by-dhcp.cox.net> (raw)

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>
---
 revision.c |   13 +++++++++++++
 revision.h |    4 ++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/revision.c b/revision.c
index db01682..8fda20d 100644
--- a/revision.c
+++ b/revision.c
@@ -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_i
 		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)) {
diff --git a/revision.h b/revision.h
index c1f71af..35a1db4 100644
--- a/revision.h
+++ b/revision.h
@@ -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;
-- 
1.4.2.1.g414e5

                 reply	other threads:[~2006-09-18  0:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vac4yyphq.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=kai.blin@gmail.com \
    --cc=peff@peff.net \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox