[Libreoffice-commits] dev-tools.git: scripts/aoo-annotate.pl
Michael Meeks
michael.meeks at suse.com
Wed Feb 27 03:55:14 PST 2013
scripts/aoo-annotate.pl | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
New commits:
commit 4fc926d002d821457d71de012ac1e86be3f386f9
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Feb 27 11:54:33 2013 +0000
pretty print a breakdown.
diff --git a/scripts/aoo-annotate.pl b/scripts/aoo-annotate.pl
index 88a80bd..c55d72b 100755
--- a/scripts/aoo-annotate.pl
+++ b/scripts/aoo-annotate.pl
@@ -67,6 +67,30 @@ sub read_log($)
return \@revisions;
}
+sub dump_breakdown($)
+{
+ my $revs = shift;
+
+ my $rev_count = scalar (@{$revs});
+ my $annotated = 0;
+ my %frequency;
+ for my $rev (@{$revs}) {
+ if($rev->{note} ne "") {
+ my $stem = $rev->{note};
+ $stem =~ s/^merged as.*$/merged:/;
+ $stem =~ s/^prefer.*$/prefer:/;
+ $frequency{$stem} = 0 if (!defined $frequency{$stem});
+ $frequency{$stem}++;
+ $annotated++;
+ }
+ }
+
+ print STDERR "$annotated annotations of $rev_count commits\n";
+ for my $stem (sort { $frequency{$b} <=> $frequency{$a} } keys %frequency) {
+ print STDERR "$frequency{$stem}\t$stem\n";
+ }
+}
+
my $git_dir = shift @ARGV;
if (!defined $git_dir) {
@@ -76,13 +100,16 @@ if (!defined $git_dir) {
my $has_note = read_git_notes($git_dir);
my $revs = read_log($git_dir);
-my $rev_count = scalar (@{$revs});
-print STDERR "Commits to scan $rev_count\n";
+print STDERR "\n";
+print STDERR "Commits:\n";
for my $rev (@{$revs}) {
my $note = $rev->{note};
chomp ($note);
print "$rev->{hash}\t$rev->{note}\n";
}
+
+print STDERR "\n";
+dump_breakdown ($revs);
More information about the Libreoffice-commits
mailing list