Skip to content

Commit 675a0fe

Browse files
committed
Merge branch 'jk/mailmap-cleanup'
Update various entries in our .mailmap file. * jk/mailmap-cleanup: contrib: update stats/mailmap script .mailmap: normalize emails for Linus Torvalds .mailmap: normalize emails for Jeff King .mailmap: fix broken entry for Martin Langhoff .mailmap: match up some obvious names/emails
2 parents 18499ba + 53474eb commit 675a0fe

File tree

2 files changed

+82
-33
lines changed

2 files changed

+82
-33
lines changed

.mailmap

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Alex Bennée <kernel-hacker@bennee.com>
99
Alexander Gavrilov <angavrilov@gmail.com>
1010
Aneesh Kumar K.V <aneesh.kumar@gmail.com>
1111
Brian M. Carlson <sandals@crustytoothpaste.ath.cx>
12+
Cheng Renquan <crquan@gmail.com>
1213
Chris Shoemaker <c.shoemaker@cox.net>
14+
Dan Johnson <computerdruid@gmail.com>
1315
Dana L. How <danahow@gmail.com>
1416
Dana L. How <how@deathvalley.cswitch.com>
1517
Daniel Barkalow <barkalow@iabervon.org>
@@ -18,14 +20,18 @@ David Kågedal <davidk@lysator.liu.se>
1820
David S. Miller <davem@davemloft.net>
1921
Deskin Miller <deskinm@umich.edu>
2022
Dirk Süsserott <newsletter@dirk.my1.cc>
23+
Eric S. Raymond <esr@thyrsus.com>
2124
Erik Faye-Lund <kusmabite@gmail.com> <kusmabite@googlemail.com>
2225
Fredrik Kuivinen <freku045@student.liu.se>
26+
Frédéric Heitzmann <frederic.heitzmann@gmail.com>
2327
H. Peter Anvin <hpa@bonde.sc.orionmulti.com>
2428
H. Peter Anvin <hpa@tazenda.sc.orionmulti.com>
2529
H. Peter Anvin <hpa@trantor.hos.anvin.org>
2630
Horst H. von Brand <vonbrand@inf.utfsm.cl>
2731
İsmail Dönmez <ismail@pardus.org.tr>
32+
Jakub Narębski <jnareb@gmail.com>
2833
Jay Soffian <jaysoffian+git@gmail.com>
34+
Jeff King <peff@peff.net> <peff@github.com>
2935
Joachim Berdal Haga <cjhaga@fys.uio.no>
3036
Johannes Sixt <j6t@kdbg.org> <johannes.sixt@telecom.at>
3137
Johannes Sixt <j6t@kdbg.org> <j.sixt@viscovery.net>
@@ -41,12 +47,21 @@ Junio C Hamano <gitster@pobox.com> <junio@hera.kernel.org>
4147
Junio C Hamano <gitster@pobox.com> <junio@kernel.org>
4248
Junio C Hamano <gitster@pobox.com> <junkio@cox.net>
4349
Karl Hasselström <kha@treskal.com>
50+
Kevin Leung <kevinlsk@gmail.com>
4451
Kent Engstrom <kent@lysator.liu.se>
4552
Lars Doelle <lars.doelle@on-line ! de>
4653
Lars Doelle <lars.doelle@on-line.de>
4754
Li Hong <leehong@pku.edu.cn>
55+
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@woody.linux-foundation.org>
56+
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@osdl.org>
57+
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@g5.osdl.org>
58+
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@evo.osdl.org>
59+
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@ppc970.osdl.org>
60+
Linus Torvalds <torvalds@linux-foundation.org> <torvalds@ppc970.osdl.org.(none)>
4861
Lukas Sandström <lukass@etek.chalmers.se>
49-
Martin Langhoff <martin@laptop.org>
62+
Marc-André Lureau <marcandre.lureau@gmail.com>
63+
Mark Rada <marada@uwaterloo.ca>
64+
Martin Langhoff <martin@laptop.org> <martin@catalyst.net.nz>
5065
Martin von Zweigbergk <martinvonz@gmail.com> <martin.von.zweigbergk@gmail.com>
5166
Michael Coleman <tutufan@gmail.com>
5267
Michael J Gruber <git@drmicha.warpmail.net> <michaeljgruber+gmane@fastmail.fm>
@@ -63,11 +78,13 @@ Ralf Thielow <ralf.thielow@gmail.com> <ralf.thielow@googlemail.com>
6378
Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
6479
René Scharfe <rene.scharfe@lsrfire.ath.cx>
6580
Robert Fitzsimons <robfitz@273k.net>
81+
Robert Zeh <robert.a.zeh@gmail.com>
6682
Sam Vilain <sam@vilain.net>
6783
Santi Béjar <sbejar@gmail.com>
6884
Sean Estabrooks <seanlkml@sympatico.ca>
6985
Shawn O. Pearce <spearce@spearce.org>
7086
Steven Grimm <koreth@midwinter.com>
87+
Tay Ray Chuan <rctay89@gmail.com>
7188
Theodore Ts'o <tytso@mit.edu>
7289
Thomas Rast <trast@inf.ethz.ch> <trast@student.ethz.ch>
7390
Tony Luck <tony.luck@intel.com>

contrib/stats/mailmap.pl

Lines changed: 64 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,70 @@
1-
#!/usr/bin/perl -w
2-
my %mailmap = ();
3-
open I, "<", ".mailmap";
4-
while (<I>) {
5-
chomp;
6-
next if /^#/;
7-
if (my ($author, $mail) = /^(.*?)\s+<(.+)>$/) {
8-
$mailmap{$mail} = $author;
9-
}
1+
#!/usr/bin/perl
2+
3+
use warnings 'all';
4+
use strict;
5+
use Getopt::Long;
6+
7+
my $match_emails;
8+
my $match_names;
9+
my $order_by = 'count';
10+
Getopt::Long::Configure(qw(bundling));
11+
GetOptions(
12+
'emails|e!' => \$match_emails,
13+
'names|n!' => \$match_names,
14+
'count|c' => sub { $order_by = 'count' },
15+
'time|t' => sub { $order_by = 'stamp' },
16+
) or exit 1;
17+
$match_emails = 1 unless $match_names;
18+
19+
my $email = {};
20+
my $name = {};
21+
22+
open(my $fh, '-|', "git log --format='%at <%aE> %aN'");
23+
while(<$fh>) {
24+
my ($t, $e, $n) = /(\S+) <(\S+)> (.*)/;
25+
mark($email, $e, $n, $t);
26+
mark($name, $n, $e, $t);
1027
}
11-
close I;
12-
13-
my %mail2author = ();
14-
open I, "git log --pretty='format:%ae %an' |";
15-
while (<I>) {
16-
chomp;
17-
my ($mail, $author) = split(/\t/, $_);
18-
next if exists $mailmap{$mail};
19-
$mail2author{$mail} ||= {};
20-
$mail2author{$mail}{$author} ||= 0;
21-
$mail2author{$mail}{$author}++;
28+
close($fh);
29+
30+
if ($match_emails) {
31+
foreach my $e (dups($email)) {
32+
foreach my $n (vals($email->{$e})) {
33+
show($n, $e, $email->{$e}->{$n});
34+
}
35+
print "\n";
36+
}
2237
}
23-
close I;
24-
25-
while (my ($mail, $authorcount) = each %mail2author) {
26-
# %$authorcount is ($author => $count);
27-
# sort and show the names from the most frequent ones.
28-
my @names = (map { $_->[0] }
29-
sort { $b->[1] <=> $a->[1] }
30-
map { [$_, $authorcount->{$_}] }
31-
keys %$authorcount);
32-
if (1 < @names) {
33-
for (@names) {
34-
print "$_ <$mail>\n";
38+
if ($match_names) {
39+
foreach my $n (dups($name)) {
40+
foreach my $e (vals($name->{$n})) {
41+
show($n, $e, $name->{$n}->{$e});
3542
}
43+
print "\n";
3644
}
3745
}
46+
exit 0;
3847

48+
sub mark {
49+
my ($h, $k, $v, $t) = @_;
50+
my $e = $h->{$k}->{$v} ||= { count => 0, stamp => 0 };
51+
$e->{count}++;
52+
$e->{stamp} = $t unless $t < $e->{stamp};
53+
}
54+
55+
sub dups {
56+
my $h = shift;
57+
return grep { keys($h->{$_}) > 1 } keys($h);
58+
}
59+
60+
sub vals {
61+
my $h = shift;
62+
return sort {
63+
$h->{$b}->{$order_by} <=> $h->{$a}->{$order_by}
64+
} keys($h);
65+
}
66+
67+
sub show {
68+
my ($n, $e, $h) = @_;
69+
print "$n <$e> ($h->{$order_by})\n";
70+
}

0 commit comments

Comments
 (0)