Hi folks,
I have just completed my Google Summer of Code[1] project[2] working for the
Wine project. Now, as I was submitting patches to a git repository, I don't
have a branch solely containing my patches or something like that. Google
seems to want something like this, so I figured maybe I could get gitweb to
filter for my patches during the SoC period. Is that possible?
If not, does it sound like something feasible to add?
Cheers,
Kai
PS: Please CC me, as I'm not on the list.
[1] http://code.google.com/soc/
[2] http://wiki.winehq.org/NtlmSigningAndSealing
--
Kai Blin, <kai Dot blin At gmail Dot com>
WorldForge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin/
--
Will code for cotton.
From: Jakub Narebski <hidden> Date: 2016-06-15 22:42:38
Kai Blin wrote:
I have just completed my Google Summer of Code[1] project[2] working for the
Wine project. Now, as I was submitting patches to a git repository, I don't
have a branch solely containing my patches or something like that. Google
seems to want something like this, so I figured maybe I could get gitweb to
filter for my patches during the SoC period. Is that possible?
If not, does it sound like something feasible to add?
You can always read the list using one of the many archives
of git@vger.kernel.org list, or using Usenet (news) client via NNTP
gateway at GMane (nntp://news.gmane.org/gmane.comp.version-control.git).
See http://git.or.cz/gitwiki/GitCommunity
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
From: Jeff King <hidden> Date: 2016-06-15 22:42:38
On Mon, Aug 28, 2006 at 02:59:21PM +0200, Kai Blin wrote:
I have just completed my Google Summer of Code[1] project[2] working for the
Wine project. Now, as I was submitting patches to a git repository, I don't
have a branch solely containing my patches or something like that. Google
seems to want something like this, so I figured maybe I could get gitweb to
filter for my patches during the SoC period. Is that possible?
If not, does it sound like something feasible to add?
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:
-- >8 --
$ cat >match-who.pl <<'EOF'
#!/usr/bin/perl
my $name = shift;
my $match = qr/$name/i;
my $commit;
while(<>) {
chomp;
next unless $_;
next if /^\s/;
my ($k, $v) = split / /, $_, 2;
if($k eq 'commit') {
$commit = $v;
}
if($commit && ($k eq 'author' || $k eq 'committer') && $v =~ $match) {
print "$commit\n";
$commit = undef;
}
}
-- >8 --
Then you should be able to do:
$ git-rev-list --pretty=raw master |
perl match-who.pl kai.blin@gmail.com |
git-diff-tree -p --stdin --pretty=email \
> my-patches
You can either look through that, or you can try applying the patches
with git-am (though if your patches depend on changes not by you that
happened in the intervening time, you'll probably have some rejects).
-Peff
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
---
From: Jonas Fonseca <hidden> Date: 2016-06-15 22:42:38
Adds the two options: --author=string and --committer=string, which can
be used to limit the set of interesting commits to the ones matching the
given idents.
Signed-off-by: Jonas Fonseca <redacted>
---
[ On top of the git-rev-list(1) update posted earlier ... ]
Linus Torvalds [off-list ref] wrote Mon, Aug 28, 2006:
Th[e] 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)
Hereby serving one patch doing the trivial thing very stupid, since I
didn't have the imagination to go and hunt for the bonus points just
yet.
Documentation/git-rev-list.txt | 6 +++++
builtin-rev-list.c | 3 ++
revision.c | 53 ++++++++++++++++++++++++++++++++++++++++
revision.h | 2 ++
4 files changed, 63 insertions(+), 1 deletions(-)
@@ -153,6 +155,10 @@ limiting may be applied. Limit the commits output to specified time range.+--author='string', --committer='string'::++ Limit the commits output to specified author and/or committer.+ --remove-empty:: Stop when a given path disappears from the tree.
@@ -671,6 +671,14 @@ int setup_revisions(int argc, const charrevs->min_age=approxidate(arg+8);continue;}+if(!strncmp(arg,"--author=",9)){+revs->author_pattern=arg+9;+continue;+}+if(!strncmp(arg,"--committer=",12)){+revs->committer_pattern=arg+12;+continue;+}if(!strcmp(arg,"--all")){handle_all(revs,flags);continue;
@@ -1015,6 +1023,47 @@ static void mark_boundary_to_show(struct}}+staticintcommit_match_ident(structcommit*commit,constchar*field,constchar*pattern)+{+constchar*pos;+intfield_len;+intpattern_len;++if(!pattern)+return1;++field_len=strlen(field);+pattern_len=strlen(pattern);++for(pos=commit->buffer;*pos!='\n';pos++){+constchar*line_end=strchr(pos,'\n');++if(!strncmp(pos,field,field_len)&&+pos[field_len]==' '){+constchar*ident_end=line_end;++pos+=field_len;+while(ident_end>pos&&ident_end[-1]!='>')+ident_end--;++/* A slow "strncasestr" */+while(pos+pattern_len<=ident_end){+if(!strncasecmp(pos,pattern,pattern_len))+return1;+pos++;+}++/* Assumes that fields that should be matched only+*appearonceinthecommitheader.*/+return0;+}++pos=line_end;+}++return0;+}+structcommit*get_revision(structrev_info*revs){structcommit_list*list=revs->commits;
@@ -71,6 +71,8 @@ struct rev_info {intmax_count;unsignedlongmax_age;unsignedlongmin_age;+constchar*author_pattern;+constchar*committer_pattern;/* diff info for patches and for paths limiting */structdiff_optionsdiffopt;
From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:38
Jonas Fonseca [off-list ref] writes:
quoted hunk
Adds the two options: --author=string and --committer=string, which can
be used to limit the set of interesting commits to the ones matching the
given idents.
@@ -352,7 +352,8 @@ int cmd_rev_list(int argc, const char **revs.diff)usage(rev_list_usage);-save_commit_buffer=revs.verbose_header;+if(!revs.author_pattern&&!revs.committer_pattern)+save_commit_buffer=revs.verbose_header;track_object_refs=0;if(bisect_list)revs.limited=1;
I wonder if it is simpler and yet more powerful to internally
use a regex to match the contents of commit buffer, not just
specific its header fields.
When --author or --committer is given, you internally synthesize
a regex "^author Jonas Fonseca <fonseca@" from the string.
And then, instead of doing commit_match_ident() twice like this:
quoted hunk
@@ -1074,6 +1123,10 @@ struct commit *get_revision(struct rev_i if (revs->no_merges && commit->parents && commit->parents->next) continue;+ if (!commit_match_ident(commit, "author", revs->author_pattern))+ continue;+ if (!commit_match_ident(commit, "committer", revs->committer_pattern))+ continue;
you would just do:
if (revs->commit_filter_pattern &&
commit_search_message(commit, revs->commit_filter_pattern))
continue;
instead.
For an extra bonus point, the matching logic might want to steal
from builtin-grep to allow multiple regular expressions, case
insensitive match and other bells and whistles. You probably
could lift the whole grep_buffer() -- add another option that
behaves similarly to opt->name_only (name it opt->status_only)
but make it not even print anything upon hit, so that you can
tell from the return value if it found the pattern in the
buffer, like this:
From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:40
I have three patch series that makes a part of git-grep
available and use it for log filtering:
[PATCH] builtin-grep: make pieces of it available as library.
[PATCH] revision traversal: prepare for commit log match.
[PATCH] revision traversal: --author, --committer, and --grep.
I didn't implement the boolean combination of patterns like
git-grep does, but it should be pretty straightforward to do so
in setup_revisions(). The syntax probably would be something
like:
git log --grep-( rev-list gitweb --and --not --author=Jakub --grep-)
to find logs that:
* talk about rev-list, or
* talk about gitweb but not by Jakub