fix scripts/authors.pl

- used to omit commits which touched only one file
- used to omit commits which only inserted or deleted lines
This commit is contained in:
Roland Kuhn 2013-08-29 11:16:59 +02:00
parent 48c83f545a
commit 701321302c

View file

@ -17,15 +17,17 @@ our $author;
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";
open $input, "git log --no-merges --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/;
next unless defined $insert;
my ($insert, $delete) = /files? changed(?:, (\d+) insertions?\(\+\))?(?:, (\d+) delet)?/;
next unless defined $author;
$insert = 0 unless defined $insert;
$delete = 0 unless defined $delete;
$auth{$author} = [0, 0, 0] unless defined($auth{$author});
my @l = @{$auth{$author}};
$auth{$author} = [$l[0] + 1, $l[1] + $insert, $l[2] + $delete];