[FFmpeg-devel] [PATCH] Add .mailmap
Josh de Kock
josh at itanimul.li
Wed Feb 26 18:27:20 EET 2020
Hi Steven,
On Mon, Feb 24, 2020, at 2:03 AM, Steven Liu wrote:
> [...]
> How can I get the script :D
>
> Thanks
>
> Steven
I won't be looking to upstream this script (the other one yes), but I will
share it here for you. You'll have to excuse my poor scripting :)
--
Josh
#!/usr/bin/env perl
use warnings;
use strict;
# cpan List::MoreUtils JSON
use Encode qw(decode);
use List::MoreUtils qw(uniq);
sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
my @shortlog = split /\n/, decode('UTF-8', `git shortlog -sne --since="last 36 months"`, Encode::FB_CROAK);
my %assembly = ();
my %developers = ();
foreach my $line (@shortlog) {
my ($count, $name, $email) = $line =~ m/^ *(\d+) *(.*?) <(.*?)>/;
# ignore
$email =~ s/ at /@/;
$name = trim $name;
if (exists($developers{$name})) {
$developers{$name}{commit_count} += $count;
push @{$developers{$name}{email}}, $email;
} else {
$developers{$name} = {
commit_count => $count,
email => [$email],
};
}
}
foreach my $key (keys %developers) {
# many people with different emails, only care about frequent committers
if ($developers{$key}{commit_count} >= 20) {
$developers{$key}{email} = [uniq @{$developers{$key}{email}}];
if (scalar @{$developers{$key}{email}} > 1) {
foreach my $email (@{$developers{$key}{email}}) {
print "$email ";
}
print "\n";
}
}
}
More information about the ffmpeg-devel
mailing list