Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update contributors.pl to include moar, nqp and roast
  • Loading branch information
FROGGS committed May 22, 2015
1 parent db5cb76 commit c9d5ec2
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions tools/contributors.pl
Expand Up @@ -5,33 +5,41 @@
#use 5.010;
use utf8;

use Cwd;
use Date::Simple qw(today ymd);

my %contrib;

my $last_release = shift;
$last_release = release_date_of_prev_month() if not defined $last_release;
my $nick_to_name = nick_to_name_from_CREDITS();
open my $c, '-|', 'git', 'log', "--since=$last_release", '--pretty=format:%an|%cn|%s'
or die "Can't open pipe to git log: $!";
binmode $c, ':encoding(UTF-8)';
while (my $line = <$c>) {
my ($author, $comitter, $msg) = split /\|/, $line, 3;
$contrib{nick_to_name($author)}++;
$contrib{nick_to_name($comitter)}++ if $comitter ne 'Rakudo Perl';
while ($msg =~ /\(([^)]{2,})\)\+\+/g) {
$contrib{nick_to_name($1)}++;
}
while ($msg =~ /([^\s():]{2,})\+\+/g) {
my $nick = $1;
next if $nick =~ /^[\$\@]/;
$contrib{nick_to_name($nick)}++;
}
while ($msg =~ /courtesy of:?\s*(\S.*)/gi) {
$contrib{nick_to_name($1)}++;

my $cwd = getcwd();

for my $dir ($cwd, "$cwd/../MoarVM", "$cwd/../nqp", "$cwd/../roast",
"$cwd/nqp", "$cwd/nqp/MoarVM", "$cwd/t/spec") {
chdir $dir if -d $dir && -d "$dir/.git/";
open my $c, '-|', 'git', 'log', "--since=$last_release", '--pretty=format:%an|%cn|%s'
or die "Can't open pipe to git log: $!";
binmode $c, ':encoding(UTF-8)';
while (my $line = <$c>) {
my ($author, $comitter, $msg) = split /\|/, $line, 3;
$contrib{nick_to_name($author)}++;
$contrib{nick_to_name($comitter)}++ if $comitter ne 'Rakudo Perl';
while ($msg =~ /\(([^)]{2,})\)\+\+/g) {
$contrib{nick_to_name($1)}++;
}
while ($msg =~ /([^\s():]{2,})\+\+/g) {
my $nick = $1;
next if $nick =~ /^[\$\@]/;
$contrib{nick_to_name($nick)}++;
}
while ($msg =~ /courtesy of:?\s*(\S.*)/gi) {
$contrib{nick_to_name($1)}++;
}
}
close $c or warn $!;
}
close $c or warn $!;

my @contrib = reverse sort { $contrib{$a} <=> $contrib{$b} } keys %contrib;

Expand Down

0 comments on commit c9d5ec2

Please sign in to comment.