5 use File
::Basename
qw(basename dirname);
7 our ($opt_h, $opt_n, $opt_s);
13 print STDERR
"Usage: ${\basename $0} [-h] [-n] [-s] < <log_data>\n";
24 sub shortlog_entry
($$) {
25 my ($name, $desc) = @_;
28 $desc =~ s
#/pub/scm/linux/kernel/git/#/.../#g;
29 $desc =~ s
#\[PATCH\] ##g;
31 # store description in array, in email->{desc list} map
32 if (exists $map{$key}) {
39 # create new array, containing 1 item
47 # sort comparison function
53 sub by_nbentries
($$) {
55 my $a_entries = $map{$a};
56 my $b_entries = $map{$b};
58 @
$b_entries - @
$a_entries || by_name
$a, $b;
61 my $sort_method = $opt_n ? \
&by_nbentries
: \
&by_name
;
64 my ($obj, $num, $key);
66 foreach $key (sort $sort_method keys %map) {
69 printf "%s: %u\n", $key, $num;
75 my ($obj, $num, $key, $desc);
77 foreach $key (sort $sort_method keys %map) {
82 printf "%s (%u):\n", $key, $num;
84 # output author's 1-line summaries
85 foreach $desc (reverse @
$obj) {
90 # blank line separating author from next author
99 # get author and email
103 next unless /^[Aa]uthor:?\s*(.*?)\s*<(.*)>/;
112 if (exists $mailmap{$email}) {
113 $author = $mailmap{$email};
114 } elsif (exists $mailmap{$author}) {
115 $author = $mailmap{$author};
119 $email{$author}{$email}++;
124 elsif ($pstate == 2) {
129 # skip to non-blank line
130 elsif ($pstate == 3) {
131 next unless /^\s*?(.*)/;
133 # skip lines that are obviously not
134 # a 1-line cset description
135 next if /^\s*From: /;
140 &shortlog_entry
($author, $desc);
146 die "invalid parse state $pstate";
152 my ($fh, $mailmap) = @_;
155 if (/^([^#].*?)\s*<(.*)>/) {
162 read_mailmap
(\
*DATA
, \
%mailmap);
165 open $fh, '<', '.mailmap';
166 read_mailmap
($fh, \
%mailmap);
172 #print "\n$n_records records parsed.\n";
174 if ($n_records != $n_output) {
175 die "parse error: input records != output records\n";
178 for my $author (sort keys %email) {
179 my $e = $email{$author};
180 for my $email (sort keys %$e) {
181 print STDERR
"$author <$email>\n";
189 $opt_s ?
&summary_output
: &shortlog_output
;
196 # Even with git, we don't always have name translations.
197 # So have an email->real name table to translate the
198 # (hopefully few) missing names
200 Adrian Bunk
<bunk
@stusta.de
>
201 Andreas Herrmann
<aherrman
@de.ibm
.com
>
202 Andrew Morton
<akpm
@osdl.org
>
203 Andrew Vasquez
<andrew
.vasquez
@qlogic.com
>
204 Christoph Hellwig
<hch
@lst.de
>
205 Corey Minyard
<minyard
@acm.org
>
206 David Woodhouse
<dwmw2
@shinybook.infradead
.org
>
207 Domen Puncer
<domen
@coderock.org
>
208 Douglas Gilbert
<dougg
@torque.net
>
209 Ed L Cashin
<ecashin
@coraid.com
>
210 Evgeniy Polyakov
<johnpol
@2ka.mipt
.ru
>
211 Felix Moeller
<felix
@derklecks.de
>
212 Frank Zago
<fzago
@systemfabricworks.com
>
213 Greg Kroah
-Hartman
<gregkh
@suse.de
>
214 James Bottomley
<jejb
@mulgrave.(none
)>
215 James Bottomley
<jejb
@titanic.il
.steeleye
.com
>
216 Jeff Garzik
<jgarzik
@pretzel.yyz
.us
>
217 Jens Axboe
<axboe
@suse.de
>
218 Kay Sievers
<kay
.sievers
@vrfy.org
>
219 Mitesh shah
<mshah
@teja.com
>
220 Morten Welinder
<terra
@gnome.org
>
221 Morten Welinder
<welinder
@anemone.rentec
.com
>
222 Morten Welinder
<welinder
@darter.rentec
.com
>
223 Morten Welinder
<welinder
@troll.com
>
224 Nguyen Anh Quynh
<aquynh
@gmail.com
>
225 Paolo
'Blaisorblade' Giarrusso
<blaisorblade
@yahoo.it
>
226 Peter A Jonsson
<pj
@ludd.ltu
.se
>
227 Ralf Wildenhues
<Ralf
.Wildenhues
@gmx.de
>
228 Rudolf Marek
<R
.Marek
@sh.cvut
.cz
>
229 Rui Saraiva
<rmps
@joel.ist
.utl
.pt
>
230 Sachin P Sant
<ssant
@in.ibm
.com
>
231 Santtu Hyrkk
\e,Av
\e(B
<santtu
.hyrkko
@gmail.com
>
232 Simon Kelley
<simon
@thekelleys.org
.uk
>
233 Tejun Heo
<htejun
@gmail.com
>
234 Tony Luck
<tony
.luck
@intel.com
>