{"thread":{"id":"32320","subject":"[PATCH 0/5] git.git .mailmap cleanups","startedAt":"2012-12-12T11:30:36Z","lastAt":"2012-12-12T11:41:41Z","messageCount":6,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"204729","messageId":"20121212113036.GB19625@sigill.intra.peff.net","threadId":"32320","inReplyTo":null,"subject":"[PATCH 0/5] git.git .mailmap cleanups","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-12-12T11:30:36Z","receivedAt":"2012-12-12T11:30:36Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"I noticed a few obvious problems in the output of \"git shortlog -nse\" on\ngit.git. So I wrote an analysis script to find more, and of course there\nwere lots.\n\nThis series tries to clean up the low-hanging fruit. The first two\ncommits fix multiple names matching a single email. Hopefully not too\ncontentious, but I'll cc all involved parties to confirm. The second has\na different root cause, so I've broken it out into its own commit.\n\n  [1/5]: .mailmap: match up some obvious names/emails\n  [2/5]: .mailmap: fix broken entry for Martin Langhoff\n\nNext up are multiple emails which match a single name. There are over a\nhundred of these, and they are much less obvious to fix. They really\nneed individuals to post patches to fix their own identities (and some\nmay not want fixing at all, if they used different emails to have\nmeaningful different identities).\n\nSo I've left these untouched except for:\n\n  [3/5]: .mailmap: normalize emails for Jeff King\n\nI am allowed to fix my own. :)\n\n  [4/5]: .mailmap: normalize emails for Linus Torvalds\n\nAs the benevolent dictator, Linus has underlings to fix such things for\nhim.\n\nAlso, his entry was the original reason I started looking at the data.\nHe fares quite poorly in \"shortlog -nse\" because his commits are\nscattered across many addresses.\n\n  [5/5]: contrib: update stats/mailmap script\n\nThis replaces the current mailmap script in contrib, which has a bug and\nlacks some of the features of my new script.\n\n-Peff\n"},{"id":"204730","messageId":"20121212113634.GA18803@sigill.intra.peff.net","threadId":"32320","inReplyTo":"20121212113036.GB19625@sigill.intra.peff.net","subject":"[PATCH 1/5] .mailmap: match up some obvious names/emails","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-12-12T11:36:35Z","receivedAt":"2012-12-12T11:36:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This patch updates git's .mailmap in cases where multiple\nnames are matched to a single email. The \"master\" name for\neach email was chosen by:\n\n  1. If the only difference is in the presence or absence\n     of accented characters, the accented form is chosen\n     (under the assumption that it is the natural spelling,\n     and accents are sometimes stripped in email).\n\n  2. Otherwise, the most commonly used name is chosen.\n\n  3. If all names are equally common, the most recently used name is\n     chosen.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI'm cc-ing all involved authors. If you object or want to normalize your\nname in some other way, please let me know.\n\n .mailmap | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/.mailmap b/.mailmap\nindex bcf4f87..69301bd 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -9,7 +9,9 @@ Chris Shoemaker <c.shoemaker@cox.net>\n Alexander Gavrilov <angavrilov@gmail.com>\n Aneesh Kumar K.V <aneesh.kumar@gmail.com>\n Brian M. Carlson <sandals@crustytoothpaste.ath.cx>\n+Cheng Renquan <crquan@gmail.com>\n Chris Shoemaker <c.shoemaker@cox.net>\n+Dan Johnson <computerdruid@gmail.com>\n Dana L. How <danahow@gmail.com>\n Dana L. How <how@deathvalley.cswitch.com>\n Daniel Barkalow <barkalow@iabervon.org>\n@@ -18,13 +20,16 @@ Horst H. von Brand <vonbrand@inf.utfsm.cl>\n David S. Miller <davem@davemloft.net>\n Deskin Miller <deskinm@umich.edu>\n Dirk Süsserott <newsletter@dirk.my1.cc>\n+Eric S. Raymond <esr@thyrsus.com>\n Erik Faye-Lund <kusmabite@gmail.com> <kusmabite@googlemail.com>\n Fredrik Kuivinen <freku045@student.liu.se>\n+Frédéric Heitzmann <frederic.heitzmann@gmail.com>\n H. Peter Anvin <hpa@bonde.sc.orionmulti.com>\n H. Peter Anvin <hpa@tazenda.sc.orionmulti.com>\n H. Peter Anvin <hpa@trantor.hos.anvin.org>\n Horst H. von Brand <vonbrand@inf.utfsm.cl>\n İsmail Dönmez <ismail@pardus.org.tr>\n+Jakub Narębski <jnareb@gmail.com>\n Jay Soffian <jaysoffian+git@gmail.com>\n Joachim Berdal Haga <cjhaga@fys.uio.no>\n Johannes Sixt <j6t@kdbg.org> <johannes.sixt@telecom.at>\n@@ -41,11 +46,14 @@ Lukas Sandström <lukass@etek.chalmers.se>\n Junio C Hamano <gitster@pobox.com> <junio@kernel.org>\n Junio C Hamano <gitster@pobox.com> <junkio@cox.net>\n Karl Hasselström <kha@treskal.com>\n+Kevin Leung <kevinlsk@gmail.com>\n Kent Engstrom <kent@lysator.liu.se>\n Lars Doelle <lars.doelle@on-line ! de>\n Lars Doelle <lars.doelle@on-line.de>\n Li Hong <leehong@pku.edu.cn>\n Lukas Sandström <lukass@etek.chalmers.se>\n+Marc-André Lureau <marcandre.lureau@gmail.com>\n+Mark Rada <marada@uwaterloo.ca>\n Martin Langhoff <martin@laptop.org>\n Martin von Zweigbergk <martinvonz@gmail.com> <martin.von.zweigbergk@gmail.com>\n Michael Coleman <tutufan@gmail.com>\n@@ -63,11 +71,13 @@ Steven Grimm <koreth@midwinter.com>\n Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>\n René Scharfe <rene.scharfe@lsrfire.ath.cx>\n Robert Fitzsimons <robfitz@273k.net>\n+Robert Zeh <robert.a.zeh@gmail.com>\n Sam Vilain <sam@vilain.net>\n Santi Béjar <sbejar@gmail.com>\n Sean Estabrooks <seanlkml@sympatico.ca>\n Shawn O. Pearce <spearce@spearce.org>\n Steven Grimm <koreth@midwinter.com>\n+Tay Ray Chuan <rctay89@gmail.com>\n Theodore Ts'o <tytso@mit.edu>\n Thomas Rast <trast@inf.ethz.ch> <trast@student.ethz.ch>\n Tony Luck <tony.luck@intel.com>\n-- \n1.8.0.2.4.g59402aa\n"},{"id":"204731","messageId":"20121212113806.GB18803@sigill.intra.peff.net","threadId":"32320","inReplyTo":"20121212113036.GB19625@sigill.intra.peff.net","subject":"[PATCH 2/5] .mailmap: fix broken entry for Martin Langhoff","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-12-12T11:38:06Z","receivedAt":"2012-12-12T11:38:06Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Commit adc3192 (Martin Langhoff has a new e-mail address,\n2010-10-05) added a mailmap entry, but forgot that both the\nold and new email addresses need to appear for one to be\nmapped to the other (i.e., we do not key mailmap emails by\nname).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n .mailmap | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/.mailmap b/.mailmap\nindex 69301bd..e370e86 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -54,7 +54,7 @@ Mark Rada <marada@uwaterloo.ca>\n Lukas Sandström <lukass@etek.chalmers.se>\n Marc-André Lureau <marcandre.lureau@gmail.com>\n Mark Rada <marada@uwaterloo.ca>\n-Martin Langhoff <martin@laptop.org>\n+Martin Langhoff <martin@laptop.org> <martin@catalyst.net.nz>\n Martin von Zweigbergk <martinvonz@gmail.com> <martin.von.zweigbergk@gmail.com>\n Michael Coleman <tutufan@gmail.com>\n Michael J Gruber <git@drmicha.warpmail.net> <michaeljgruber+gmane@fastmail.fm>\n-- \n1.8.0.2.4.g59402aa\n"},{"id":"204732","messageId":"20121212113826.GC18803@sigill.intra.peff.net","threadId":"32320","inReplyTo":"20121212113036.GB19625@sigill.intra.peff.net","subject":"[PATCH 3/5] .mailmap: normalize emails for Jeff King","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-12-12T11:38:26Z","receivedAt":"2012-12-12T11:38:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"I never meant anything special by using my @github.com\naddress; it is merely a mistake that it has sometimes bled\nthrough to patches.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n .mailmap | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/.mailmap b/.mailmap\nindex e370e86..4a27b7f 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -31,6 +31,7 @@ Jay Soffian <jaysoffian+git@gmail.com>\n İsmail Dönmez <ismail@pardus.org.tr>\n Jakub Narębski <jnareb@gmail.com>\n Jay Soffian <jaysoffian+git@gmail.com>\n+Jeff King <peff@peff.net> <peff@github.com>\n Joachim Berdal Haga <cjhaga@fys.uio.no>\n Johannes Sixt <j6t@kdbg.org> <johannes.sixt@telecom.at>\n Johannes Sixt <j6t@kdbg.org> <j.sixt@viscovery.net>\n-- \n1.8.0.2.4.g59402aa\n"},{"id":"204733","messageId":"20121212114104.GD18803@sigill.intra.peff.net","threadId":"32320","inReplyTo":"20121212113036.GB19625@sigill.intra.peff.net","subject":"[PATCH 4/5] .mailmap: normalize emails for Linus Torvalds","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-12-12T11:41:04Z","receivedAt":"2012-12-12T11:41:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Linus used a lot of different per-machine email addresses in\nthe early days. This means that \"git shortlog -nse\" does not\naggregate his counts, and he is listed well below where he\nshould be (8th instead of 3rd).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nLinus,\n\nI recall you considered \"email ident from random machine\" as a feature\nvery early on in git's history, but you seem to have settled on using\nthe linux-foundation address pretty consistently these days. Please let\nme know if you object to normalizing your entries in this way.\n\n .mailmap | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/.mailmap b/.mailmap\nindex 4a27b7f..c7e8618 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -52,6 +52,12 @@ Li Hong <leehong@pku.edu.cn>\n Lars Doelle <lars.doelle@on-line ! de>\n Lars Doelle <lars.doelle@on-line.de>\n Li Hong <leehong@pku.edu.cn>\n+Linus Torvalds <torvalds@linux-foundation.org> <torvalds@woody.linux-foundation.org>\n+Linus Torvalds <torvalds@linux-foundation.org> <torvalds@osdl.org>\n+Linus Torvalds <torvalds@linux-foundation.org> <torvalds@g5.osdl.org>\n+Linus Torvalds <torvalds@linux-foundation.org> <torvalds@evo.osdl.org>\n+Linus Torvalds <torvalds@linux-foundation.org> <torvalds@ppc970.osdl.org>\n+Linus Torvalds <torvalds@linux-foundation.org> <torvalds@ppc970.osdl.org.(none)>\n Lukas Sandström <lukass@etek.chalmers.se>\n Marc-André Lureau <marcandre.lureau@gmail.com>\n Mark Rada <marada@uwaterloo.ca>\n-- \n1.8.0.2.4.g59402aa\n"},{"id":"204734","messageId":"20121212114141.GE18803@sigill.intra.peff.net","threadId":"32320","inReplyTo":"20121212113036.GB19625@sigill.intra.peff.net","subject":"[PATCH 5/5] contrib: update stats/mailmap script","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-12-12T11:41:41Z","receivedAt":"2012-12-12T11:41:41Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This version changes quite a few things:\n\n  1. The original parsed the mailmap file itself, and it did\n     it wrong (it did not understand entries with an extra\n     email key).\n\n     Instead, this version uses git's \"%aE\" and \"%aN\"\n     formats to have git perform the mapping, meaning we do\n     not have to read .mailmap at all, but still operate on\n     the current state that git sees (and it also works\n     properly from subdirs).\n\n  2. The original would find multiple names for an email,\n     but not the other way around.\n\n     This version can do either or both. If we find multiple\n     emails for a name, the resolution is less obvious than\n     the other way around. However, it can still be a\n     starting point for a human to investigate.\n\n  3. The original would order only by count, not by recency.\n\n     This version can do either. Combined with showing the\n     counts, it can be easier to decide how to resolve.\n\n  4. This version shows similar entries in a blank-delimited\n     stanza, which makes it more clear which options you are\n     picking from.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n contrib/stats/mailmap.pl | 108 ++++++++++++++++++++++++++++++-----------------\n 1 file changed, 70 insertions(+), 38 deletions(-)\n rewrite contrib/stats/mailmap.pl (97%)\n\ndiff --git a/contrib/stats/mailmap.pl b/contrib/stats/mailmap.pl\ndissimilarity index 97%\nindex 4b852e2..9513f5e 100755\n--- a/contrib/stats/mailmap.pl\n+++ b/contrib/stats/mailmap.pl\n@@ -1,38 +1,70 @@\n-#!/usr/bin/perl -w\n-my %mailmap = ();\n-open I, \"<\", \".mailmap\";\n-while (<I>) {\n-\tchomp;\n-\tnext if /^#/;\n-\tif (my ($author, $mail) = /^(.*?)\\s+<(.+)>$/) {\n-\t\t$mailmap{$mail} = $author;\n-\t}\n-}\n-close I;\n-\n-my %mail2author = ();\n-open I, \"git log --pretty='format:%ae\t%an' |\";\n-while (<I>) {\n-\tchomp;\n-\tmy ($mail, $author) = split(/\\t/, $_);\n-\tnext if exists $mailmap{$mail};\n-\t$mail2author{$mail} ||= {};\n-\t$mail2author{$mail}{$author} ||= 0;\n-\t$mail2author{$mail}{$author}++;\n-}\n-close I;\n-\n-while (my ($mail, $authorcount) = each %mail2author) {\n-\t# %$authorcount is ($author => $count);\n-\t# sort and show the names from the most frequent ones.\n-\tmy @names = (map { $_->[0] }\n-\t\tsort { $b->[1] <=> $a->[1] }\n-\t\tmap { [$_, $authorcount->{$_}] }\n-\t\tkeys %$authorcount);\n-\tif (1 < @names) {\n-\t\tfor (@names) {\n-\t\t\tprint \"$_ <$mail>\\n\";\n-\t\t}\n-\t}\n-}\n-\n+#!/usr/bin/perl\n+\n+use warnings 'all';\n+use strict;\n+use Getopt::Long;\n+\n+my $match_emails;\n+my $match_names;\n+my $order_by = 'count';\n+Getopt::Long::Configure(qw(bundling));\n+GetOptions(\n+\t'emails|e!' => \\$match_emails,\n+\t'names|n!'  => \\$match_names,\n+\t'count|c'   => sub { $order_by = 'count' },\n+\t'time|t'    => sub { $order_by = 'stamp' },\n+) or exit 1;\n+$match_emails = 1 unless $match_names;\n+\n+my $email = {};\n+my $name = {};\n+\n+open(my $fh, '-|', \"git log --format='%at <%aE> %aN'\");\n+while(<$fh>) {\n+\tmy ($t, $e, $n) = /(\\S+) <(\\S+)> (.*)/;\n+\tmark($email, $e, $n, $t);\n+\tmark($name, $n, $e, $t);\n+}\n+close($fh);\n+\n+if ($match_emails) {\n+\tforeach my $e (dups($email)) {\n+\t\tforeach my $n (vals($email->{$e})) {\n+\t\t\tshow($n, $e, $email->{$e}->{$n});\n+\t\t}\n+\t\tprint \"\\n\";\n+\t}\n+}\n+if ($match_names) {\n+\tforeach my $n (dups($name)) {\n+\t\tforeach my $e (vals($name->{$n})) {\n+\t\t\tshow($n, $e, $name->{$n}->{$e});\n+\t\t}\n+\t\tprint \"\\n\";\n+\t}\n+}\n+exit 0;\n+\n+sub mark {\n+\tmy ($h, $k, $v, $t) = @_;\n+\tmy $e = $h->{$k}->{$v} ||= { count => 0, stamp => 0 };\n+\t$e->{count}++;\n+\t$e->{stamp} = $t unless $t < $e->{stamp};\n+}\n+\n+sub dups {\n+\tmy $h = shift;\n+\treturn grep { keys($h->{$_}) > 1 } keys($h);\n+}\n+\n+sub vals {\n+\tmy $h = shift;\n+\treturn sort {\n+\t\t$h->{$b}->{$order_by} <=> $h->{$a}->{$order_by}\n+\t} keys($h);\n+}\n+\n+sub show {\n+\tmy ($n, $e, $h) = @_;\n+\tprint \"$n <$e> ($h->{$order_by})\\n\";\n+}\n-- \n1.8.0.2.4.g59402aa\n"}]}