* author/commit counts
@ 2006-12-23 2:10 Randy Dunlap
2006-12-23 2:37 ` Shawn Pearce
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Randy Dunlap @ 2006-12-23 2:10 UTC (permalink / raw)
To: git
Hi,
Someone asked me a few days ago about their patches being merged yet
(e.g., how to see their commits in a git tree).
Someone else asked (in general) about commit or author counts.
I pointed the first person to "git log" and/or gitweb.
For the second, there are probably lots of scripts out there
but I didn't find them. Where are they?
Is this useful? or it needs fixing?
or you already have better solutions?
example:
git log v2.6.19.. | authorcount -m | less
# this is just the ones with >= 50 Author: lines
Al Viro : 213
Linus Torvalds : 94
Jiri Slaby : 90
Josef Sipek : 79
Gerrit Renker : 77
Adrian Bunk : 67
Andrew Morton : 59
Tejun Heo : 52
Mariusz Kozlowski : 52
Paul Mundt : 51
Ralf Baechle : 50
---
#! /usr/bin/perl
# Copyright (C) 2006, Randy Dunlap.
# read stdin, drop non-author: lines, count/sum/tally author: lines by
# each author after sanitizing author-name somewhat.
#
# optionally print out in author-name (-a) alpha order
# or in numeric/count (-n) order (low-to-high)
# or in numeric/count (-m) order (high-to-low) ("max" first)
# hash for author names:
my %authors;
my $auth;
my $sortby;
sub usage()
{
print "usage: authorcount [-a | -n | -m] < git.log.lines\n";
exit(1);
}
$sortby = $ARGV[0];
if (($sortby ne "") && ($sortby ne "-a") && ($sortby ne "-n") &&
($sortby ne "-m"))
{
print "Invalid sort option: $sortby\n";
usage();
}
READIN: while ($line = <STDIN>)
{
chomp $line;
next READIN if $line !~ /Author:/;
$auth = $line;
$auth =~ s/Author: //;
$auth =~ s/<.*>//;
$authors{$auth}++;
} # end READIN
sub byvalue
{
$authors{$a} <=> $authors{$b};
}
# optionally sort by author name or author counts
# print out the tally array
if ($sortby eq "-a")
{
foreach $auth (sort keys %authors)
{
print "$auth: $authors{$auth}\n";
}
}
elsif ($sortby eq "-n")
{
foreach $auth (sort byvalue keys %authors)
{
print "$auth: $authors{$auth}\n";
}
}
elsif ($sortby eq "-m")
{
foreach $auth (reverse sort byvalue keys %authors)
{
print "$auth: $authors{$auth}\n";
}
}
else # no sort, just hash order
{
while (($auth, $count) = each(%authors))
{
print "$auth: $count\n";
}
}
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: author/commit counts
2006-12-23 2:10 author/commit counts Randy Dunlap
@ 2006-12-23 2:37 ` Shawn Pearce
2006-12-23 4:44 ` Linus Torvalds
2006-12-23 14:28 ` Johannes Schindelin
2006-12-23 4:37 ` Randal L. Schwartz
` (2 subsequent siblings)
3 siblings, 2 replies; 12+ messages in thread
From: Shawn Pearce @ 2006-12-23 2:37 UTC (permalink / raw)
To: Randy Dunlap; +Cc: git
Randy Dunlap <rdunlap@xenotime.net> wrote:
> Someone asked me a few days ago about their patches being merged yet
> (e.g., how to see their commits in a git tree).
> Someone else asked (in general) about commit or author counts.
I often do `git log --author=Shawn next@{1}..next` to see what
commits of mine Junio has recently merged into git.git since my
last fetch. Since I'm the only Shawn (with that spelling) that
contributes to git.git this works rather well to show my work. ;-)
> I pointed the first person to "git log" and/or gitweb.
> For the second, there are probably lots of scripts out there
> but I didn't find them. Where are they?
Here's another variant showing the top 20 committers to git.git,
no Perl involved:
$ git log | grep ^Author | cut -d\< -f1 | sort \
| uniq -c | sort -n -r | head -20
3728 Author: Junio C Hamano
842 Author: Linus Torvalds
250 Author: Johannes Schindelin
217 Author: Jakub Narebski
194 Author: Eric Wong
166 Author: Petr Baudis
150 Author: Paul Mackerras
147 Author: Kay Sievers
88 Author: Nicolas Pitre
77 Author: Rene Scharfe
67 Author: Shawn Pearce
57 Author: Martin Langhoff
53 Author: Fredrik Kuivinen
52 Author: Nick Hengeveld
52 Author: Matthias Urlichs
49 Author: Daniel Barkalow
47 Author: Ryan Anderson
46 Author: Shawn O. Pearce
45 Author: Sergey Vlasov
45 Author: Luben Tuikov
The only issue I have with that is I seem to have two attributions
in git.git: 'Shawn Pearce' and 'Shawn O. Pearce'. Technically I'm
in the top 10 by commit volume but its not immediately clear because
of the two attributions being used. Really my only issue here is
why sometimes my middle initial gets used and other times it doesn't.
You can also see the very clear gap between Junio and the rest of the
world. There's very little dispute about who really codes Git. :-)
I'm personally suprised at Pasky's ranking: 166 commits! I did
not realize he had contributed so frequently to git.git itself.
--
Shawn.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: author/commit counts
2006-12-23 2:37 ` Shawn Pearce
@ 2006-12-23 4:44 ` Linus Torvalds
2006-12-23 14:28 ` Johannes Schindelin
1 sibling, 0 replies; 12+ messages in thread
From: Linus Torvalds @ 2006-12-23 4:44 UTC (permalink / raw)
To: Shawn Pearce; +Cc: Randy Dunlap, git
On Fri, 22 Dec 2006, Shawn Pearce wrote:
>
> Here's another variant showing the top 20 committers to git.git,
> no Perl involved:
This is what I've done a few times. For the kernel, I actually find the
"Signed-off-by:" lines to be more relevant to me (since it shows a
combination of authorship and maintainership, something that I value a lot
personally), but I've done statistics on both authors and signers-off )and
committers, but that mainly just shows who uses git to sync and who does
not), and I've never written any real scripts for it, I just end up doing
it with some one-liner shell thing using grep, cut, sort and uniq.
Linus
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 2:37 ` Shawn Pearce
2006-12-23 4:44 ` Linus Torvalds
@ 2006-12-23 14:28 ` Johannes Schindelin
1 sibling, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2006-12-23 14:28 UTC (permalink / raw)
To: git
Shawn Pearce <spearce <at> spearce.org> writes:
> $ git log | grep ^Author | cut -d\< -f1 | sort \
> | uniq -c | sort -n -r | head -20
As Junio pointed out in another mail, "git shortlog -n -s | head -20" is
shorter...
> You can also see the very clear gap between Junio and the rest of the
> world. There's very little dispute about who really codes Git.
Note that this still holds when doing the technically correct thing:
$ git shortlog -n -s --no-merges
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 2:10 author/commit counts Randy Dunlap
2006-12-23 2:37 ` Shawn Pearce
@ 2006-12-23 4:37 ` Randal L. Schwartz
2006-12-23 5:27 ` Randy Dunlap
2006-12-23 4:43 ` Junio C Hamano
2006-12-23 5:06 ` Nicolas Pitre
3 siblings, 1 reply; 12+ messages in thread
From: Randal L. Schwartz @ 2006-12-23 4:37 UTC (permalink / raw)
To: Randy Dunlap; +Cc: git
>>>>> "Randy" == Randy Dunlap <rdunlap@xenotime.net> writes:
Randy> example:
Randy> git log v2.6.19.. | authorcount -m | less
Randy> # this is just the ones with >= 50 Author: lines
Randy> Al Viro : 213
Randy> Linus Torvalds : 94
Randy> Jiri Slaby : 90
Randy> Josef Sipek : 79
Randy> Gerrit Renker : 77
Randy> Adrian Bunk : 67
Randy> Andrew Morton : 59
Randy> Tejun Heo : 52
Randy> Mariusz Kozlowski : 52
Randy> Paul Mundt : 51
Randy> Ralf Baechle : 50
Randy> ---
With
git-log --pretty=short v2.6.19.. | git-shortlog -n -s | head -10
and no additional tools, I get:
Al Viro: 213
Linus Torvalds: 94
Jiri Slaby: 90
Josef Sipek: 79
Gerrit Renker: 77
Adrian Bunk: 67
Andrew Morton: 59
Tejun Heo: 52
Mariusz Kozlowski: 52
Paul Mundt: 51
Looky there.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: author/commit counts
2006-12-23 4:37 ` Randal L. Schwartz
@ 2006-12-23 5:27 ` Randy Dunlap
0 siblings, 0 replies; 12+ messages in thread
From: Randy Dunlap @ 2006-12-23 5:27 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: git
On 22 Dec 2006 20:37:00 -0800 Randal L. Schwartz wrote:
> >>>>> "Randy" == Randy Dunlap <rdunlap@xenotime.net> writes:
>
> Randy> example:
> Randy> git log v2.6.19.. | authorcount -m | less
>
> Randy> # this is just the ones with >= 50 Author: lines
>
> Randy> Al Viro : 213
> Randy> Linus Torvalds : 94
> Randy> Jiri Slaby : 90
> Randy> Josef Sipek : 79
> Randy> Gerrit Renker : 77
> Randy> Adrian Bunk : 67
> Randy> Andrew Morton : 59
> Randy> Tejun Heo : 52
> Randy> Mariusz Kozlowski : 52
> Randy> Paul Mundt : 51
> Randy> Ralf Baechle : 50
> Randy> ---
>
> With
>
> git-log --pretty=short v2.6.19.. | git-shortlog -n -s | head -10
>
> and no additional tools, I get:
>
> Al Viro: 213
> Linus Torvalds: 94
> Jiri Slaby: 90
> Josef Sipek: 79
> Gerrit Renker: 77
> Adrian Bunk: 67
> Andrew Morton: 59
> Tejun Heo: 52
> Mariusz Kozlowski: 52
> Paul Mundt: 51
>
> Looky there.
Yep, that's nice. Thanks.
---
~Randy
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 2:10 author/commit counts Randy Dunlap
2006-12-23 2:37 ` Shawn Pearce
2006-12-23 4:37 ` Randal L. Schwartz
@ 2006-12-23 4:43 ` Junio C Hamano
2006-12-23 5:24 ` Randy Dunlap
2006-12-23 5:06 ` Nicolas Pitre
3 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2006-12-23 4:43 UTC (permalink / raw)
To: Randy Dunlap; +Cc: git
Randy Dunlap <rdunlap@xenotime.net> writes:
> Is this useful? or it needs fixing?
> or you already have better solutions?
>
> example:
> git log v2.6.19.. | authorcount -m | less
Perhaps you are talking about this command?
$ git shortlog -n -s v2.6.19..
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 4:43 ` Junio C Hamano
@ 2006-12-23 5:24 ` Randy Dunlap
2006-12-23 5:29 ` Shawn Pearce
0 siblings, 1 reply; 12+ messages in thread
From: Randy Dunlap @ 2006-12-23 5:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Fri, 22 Dec 2006 20:43:54 -0800 Junio C Hamano wrote:
> Randy Dunlap <rdunlap@xenotime.net> writes:
>
> > Is this useful? or it needs fixing?
> > or you already have better solutions?
> >
> > example:
> > git log v2.6.19.. | authorcount -m | less
>
> Perhaps you are talking about this command?
>
> $ git shortlog -n -s v2.6.19..
Yes, thanks, probably something like that....
git version 1.4.3.GIT
> git shortlog -n -s v2.6.19..
Can't open v2.6.19..: No such file or directory at /usr/local/bin/git-shortlog line 99.
---
~Randy
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 5:24 ` Randy Dunlap
@ 2006-12-23 5:29 ` Shawn Pearce
0 siblings, 0 replies; 12+ messages in thread
From: Shawn Pearce @ 2006-12-23 5:29 UTC (permalink / raw)
To: Randy Dunlap; +Cc: Junio C Hamano, git
Randy Dunlap <rdunlap@xenotime.net> wrote:
> Yes, thanks, probably something like that....
>
> git version 1.4.3.GIT
>
> > git shortlog -n -s v2.6.19..
> Can't open v2.6.19..: No such file or directory at /usr/local/bin/git-shortlog line 99.
The git-shortlog being discussed is the new builtin shortlog,
which has not been released yet. Try the 'master' branch in git.git.
--
Shawn.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 2:10 author/commit counts Randy Dunlap
` (2 preceding siblings ...)
2006-12-23 4:43 ` Junio C Hamano
@ 2006-12-23 5:06 ` Nicolas Pitre
2006-12-23 14:22 ` Johannes Schindelin
3 siblings, 1 reply; 12+ messages in thread
From: Nicolas Pitre @ 2006-12-23 5:06 UTC (permalink / raw)
To: Randy Dunlap; +Cc: git
On Fri, 22 Dec 2006, Randy Dunlap wrote:
> Hi,
>
> Someone asked me a few days ago about their patches being merged yet
> (e.g., how to see their commits in a git tree).
See the --author=<string> option to git log.
> Someone else asked (in general) about commit or author counts.
>
> I pointed the first person to "git log" and/or gitweb.
> For the second, there are probably lots of scripts out there
> but I didn't find them. Where are they?
Try git shortlog -s. If you combine the two like:
git log --author=<blah> | git shortlog -s
then you'll have a commit count for <blah> only.
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: author/commit counts
2006-12-23 5:06 ` Nicolas Pitre
@ 2006-12-23 14:22 ` Johannes Schindelin
2006-12-23 14:31 ` Nicolas Pitre
0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2006-12-23 14:22 UTC (permalink / raw)
To: Nicolas Pitre; +Cc: Randy Dunlap, git
Hi,
On Sat, 23 Dec 2006, Nicolas Pitre wrote:
> git log --author=<blah> | git shortlog -s
Note that the builtin shortlog reuses the fine revision walking machinery:
git shortlog --author=<blah> -n -s
works like a charm.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: author/commit counts
2006-12-23 14:22 ` Johannes Schindelin
@ 2006-12-23 14:31 ` Nicolas Pitre
0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Pitre @ 2006-12-23 14:31 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Randy Dunlap, git
On Sat, 23 Dec 2006, Johannes Schindelin wrote:
> Hi,
>
> On Sat, 23 Dec 2006, Nicolas Pitre wrote:
>
> > git log --author=<blah> | git shortlog -s
>
> Note that the builtin shortlog reuses the fine revision walking machinery:
>
> git shortlog --author=<blah> -n -s
>
> works like a charm.
I know and use it myself. But many people might not have a recent
enough git version for that.
Nicolas
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-12-23 14:31 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-23 2:10 author/commit counts Randy Dunlap
2006-12-23 2:37 ` Shawn Pearce
2006-12-23 4:44 ` Linus Torvalds
2006-12-23 14:28 ` Johannes Schindelin
2006-12-23 4:37 ` Randal L. Schwartz
2006-12-23 5:27 ` Randy Dunlap
2006-12-23 4:43 ` Junio C Hamano
2006-12-23 5:24 ` Randy Dunlap
2006-12-23 5:29 ` Shawn Pearce
2006-12-23 5:06 ` Nicolas Pitre
2006-12-23 14:22 ` Johannes Schindelin
2006-12-23 14:31 ` Nicolas Pitre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox