Skip to content

Commit

Permalink
tweak authors.pl convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuhn committed Dec 10, 2011
1 parent f4fd207 commit 57d8859
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/authors.pl
Expand Up @@ -15,9 +15,16 @@
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}};
Expand Down

0 comments on commit 57d8859

Please sign in to comment.