Include a calculation and printing of total Lines

This commit is contained in:
Bradley M. Kuhn 2014-02-15 14:25:08 -05:00
parent c555532725
commit 65cab7dfc0

View file

@ -55,10 +55,11 @@ for my $file (<*.diffstat>) {
unless defined $commit{files} and defined $commit{insertions} unless defined $commit{files} and defined $commit{insertions}
and defined $commit{deletions}; and defined $commit{deletions};
close DIFFSTAT; die "error reading $file: $!" unless ($? == 0); close DIFFSTAT; die "error reading $file: $!" unless ($? == 0);
$commit{totalLines} = $commit{insertions} + $commit{deletions};
$commitTotals{$commitID} = \%commit; $commitTotals{$commitID} = \%commit;
} }
foreach my $type (qw/files insertions deletions/) { foreach my $type (qw/files insertions deletions totalLines/) {
print "Sorted by $type:\n"; print "Sorted by $type:\n";
foreach my $commitID ( foreach my $commitID (
sort { $commitTotals{$a}{$type} <=> $commitTotals{$b}{$type} } sort { $commitTotals{$a}{$type} <=> $commitTotals{$b}{$type} }