| if (my ($author, $mail) = /^(.*?)\s+<(.+)>$/) { |
| $mailmap{$mail} = $author; |
| open I, "git log --pretty='format:%ae %an' |"; |
| my ($mail, $author) = split(/\t/, $_); |
| next if exists $mailmap{$mail}; |
| $mail2author{$mail} ||= {}; |
| $mail2author{$mail}{$author} ||= 0; |
| $mail2author{$mail}{$author}++; |
| while (my ($mail, $authorcount) = each %mail2author) { |
| # %$authorcount is ($author => $count); |
| # sort and show the names from the most frequent ones. |
| my @names = (map { $_->[0] } |
| sort { $b->[1] <=> $a->[1] } |
| map { [$_, $authorcount->{$_}] } |