Permalink
Browse files

tweak authors.pl convenience

  • Loading branch information...
1 parent f4fd207 commit 57d88594b6ed4655ca142c6f21abe5d97a3f414c @rkuhn rkuhn committed Dec 10, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 scripts/authors.pl
View
@@ -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}};

0 comments on commit 57d8859

Please sign in to comment.