From: Linus Torvalds <torvalds@osdl.org>
To: Jeff King <peff@peff.net>
Cc: Kai Blin <kai.blin@gmail.com>, git@vger.kernel.org
Subject: Re: gitweb filter for patches by a specific person in a specific timeframe
Date: Mon, 28 Aug 2006 12:04:28 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0608281147420.27779@g5.osdl.org> (raw)
In-Reply-To: <20060828181626.GB2950@coredump.intra.peff.net>
On Mon, 28 Aug 2006, Jeff King wrote:
>
> You can create an mbox of all of the changes you made. Unfortunately
> git-rev-list doesn't do author/committer matching, so you'll need a
> short perl script:
The author/committer matching is something that people have talked about
for a long time, so maybe we should just add it?
It shouldn't be that hard at all. Just add logic to revision.c:
get_revision(), something like the appended (fleshed out and fixed, of
course, with all the command line flags added to actually allow setting of
"revs->author_pattern" etc..)
A good thing for some beginning git hacker to try doing. Hint, hint.
(The only subtle thing might be to make sure that "save_commit_buffer" is
set if author/committer matching is on, so that the "commit->buffer" thing
is actually saved after parsing, so that you can match it)
This trivial approach doesn't allow "gitk" to show the results sanely,
though (to do that, you'd need to make the commit matching be part of the
parent simplification instead - that would be extra bonus points for the
intrpid git hacker-wannabe)
Linus
---
diff --git a/revision.c b/revision.c
index 1d89d72..88cc1e3 100644
--- a/revision.c
+++ b/revision.c
@@ -1011,6 +1011,13 @@ static void mark_boundary_to_show(struct
}
}
+static int commit_match(struct commit *commit, const char *field, const char *pattern)
+{
+ if (!pattern)
+ return 1;
+ .. match it here ..
+}
+
struct commit *get_revision(struct rev_info *revs)
{
struct commit_list *list = revs->commits;
@@ -1070,6 +1077,10 @@ struct commit *get_revision(struct rev_i
if (revs->no_merges &&
commit->parents && commit->parents->next)
continue;
+ if (!commit_match(commit, "author", revs->author_pattern))
+ continue;
+ if (!commit_match(commit, "committer", revs->committer_pattern))
+ continue;
if (revs->prune_fn && revs->dense) {
/* Commit without changes? */
if (!(commit->object.flags & TREECHANGE)) {
next prev parent reply other threads:[~2006-08-28 19:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-28 12:59 gitweb filter for patches by a specific person in a specific timeframe Kai Blin
2006-08-28 13:13 ` Jakub Narebski
2006-08-28 18:16 ` Jeff King
2006-08-28 19:04 ` Linus Torvalds [this message]
2006-08-31 22:57 ` [PATCH] Support author and commiter based revision list limiting Jonas Fonseca
2006-09-01 0:07 ` Junio C Hamano
2006-09-18 0:40 ` git log --author='Jeff King' Junio C Hamano
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=Pine.LNX.4.64.0608281147420.27779@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=git@vger.kernel.org \
--cc=kai.blin@gmail.com \
--cc=peff@peff.net \
/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;
as well as URLs for NNTP newsgroup(s).