From 65cab7dfc05aebaf274da4a5c82bb8b5c3180d71 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sat, 15 Feb 2014 14:25:08 -0500 Subject: [PATCH] Include a calculation and printing of total Lines --- diffstat-total-compare.plx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diffstat-total-compare.plx b/diffstat-total-compare.plx index 6124323..5a3746a 100755 --- a/diffstat-total-compare.plx +++ b/diffstat-total-compare.plx @@ -55,10 +55,11 @@ for my $file (<*.diffstat>) { unless defined $commit{files} and defined $commit{insertions} and defined $commit{deletions}; close DIFFSTAT; die "error reading $file: $!" unless ($? == 0); + $commit{totalLines} = $commit{insertions} + $commit{deletions}; $commitTotals{$commitID} = \%commit; } -foreach my $type (qw/files insertions deletions/) { +foreach my $type (qw/files insertions deletions totalLines/) { print "Sorted by $type:\n"; foreach my $commitID ( sort { $commitTotals{$a}{$type} <=> $commitTotals{$b}{$type} }