tweak authors.pl convenience

This commit is contained in:
Roland 2011-12-10 10:27:36 +01:00
parent f4fd207fdc
commit 57d88594b6

View file

@ -15,9 +15,16 @@ our $insertions;
our $deletions;
our $author;
while (<>) {
my $input;
if (@ARGV > 0) {
open $input, "git log --shortstat -z --minimal -w -C $ARGV[0]|" or die "cannot open pipe for $ARGV[0]: $!\n";
} else {
$input = \*STDIN;
}
while (<$input>) {
($author) = /Author: (.*) </;
my ($insert, $delete) = /files changed, (\d+) insert.*(\d+) delet/;
my ($insert, $delete) = /files changed, (\d+) insert.* (\d+) delet/;
next unless defined $insert;
$auth{$author} = [0, 0, 0] unless defined($auth{$author});
my @l = @{$auth{$author}};