[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2014-07-02 Thread Stephan Bergmann
 scripts/annotate.pl |2 --
 1 file changed, 2 deletions(-)

New commits:
commit b410eced21f8bc3a99c0f385f0759b5e2f8d18d5
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Jul 2 09:28:46 2014 +0200

annotate.pl: remove redundant output

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index fc07b36..14e36e3 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -230,8 +230,6 @@ if (!$list  !$stats  !$fetch) {
exit 1;
 }
 
-print $note_text' '$note_hash\n;
-
 validate_check_note($note_text);
 validate_git_hash($note_hash) ||
die Hash on master '$note_hash' doesn't look like a git hash\n;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl scripts/esc-bug-stats.pl

2014-04-22 Thread Michael Meeks
 scripts/annotate.pl  |3 ++-
 scripts/esc-bug-stats.pl |2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d1e5102ab1950b95bb37f3995f687b5fc50a4d1e
Author: Michael Meeks michael.me...@collabora.com
Date:   Tue Apr 22 10:43:58 2014 +0100

cleanup annotations, expand bugzilla black-list

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 70e0016..fc07b36 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -113,6 +113,7 @@ sub dump_breakdown($)
$stem =~ s/^merged as.*$/merged as:/;
$stem =~ s/^prefer.*$/prefer:/;
$stem =~ s/^reject.*$/reject:/;
+   $stem =~ s/^ignore.*$/ignore:/; # don't breakdown reasons anymore.
$frequency{$stem} = 0 if (!defined $frequency{$stem});
$frequency{$stem}++;
$annotated++;
@@ -135,7 +136,7 @@ sub dump_breakdown($)
print $frequency{$stem}\t$stem\n;
 }
 print contiguous annotations: $contiguous - contiguous\n;
-print contiguous tolerating $in_start_limit_max missing: 
$contiguous_limit\n;
+#print contiguous tolerating $in_start_limit_max missing: 
$contiguous_limit\n;
 }
 
 sub sanity_check_revs($$)
diff --git a/scripts/esc-bug-stats.pl b/scripts/esc-bug-stats.pl
index 69a9dfb..487bf1b 100755
--- a/scripts/esc-bug-stats.pl
+++ b/scripts/esc-bug-stats.pl
@@ -42,6 +42,8 @@ my %sadly_non_libreoffice = (
 'Peter Hutterer' = 1,
 'Guillaume Desmottes' = 1,
 'Bryce Harrington' = 1,
+'Paolo Zanoni' = 1,
+'David Faure' = 1,
 );
 
 # use me for testing XML pretty printing etc.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2013-08-15 Thread Stephan Bergmann
 scripts/annotate.pl |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6f4d92a1a4e3076f203b700f1c3a43153bde4154
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Aug 15 08:59:56 2013 +0200

Make error output of annotate.pl w/o args more friendly

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 1e6b8c1..70e0016 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -224,13 +224,13 @@ if (!defined $git_dir) {
 }
 
 if (!$list  !$stats  !$fetch) {
-
-print $note_text' '$note_hash\n;
 if (!defined $note_text || !defined $note_hash) {
usage();
-   die need some note text;
+   exit 1;
 }
 
+print $note_text' '$note_hash\n;
+
 validate_check_note($note_text);
 validate_git_hash($note_hash) ||
die Hash on master '$note_hash' doesn't look like a git hash\n;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2013-06-05 Thread Caolán McNamara
 scripts/annotate.pl |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 331d4b3000a4f5b8fddd492c7deb2bb2526206f1
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jun 5 11:09:54 2013 +0100

show unannotated count

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 8bcad14..1e6b8c1 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -128,7 +128,9 @@ sub dump_breakdown($)
}
 }
 
-print $annotated annotations of $rev_count commits\n;
+my $todo = $rev_count - $annotated;
+
+print $annotated annotations of $rev_count commits. $todo unannotated\n;
 for my $stem (sort { $frequency{$b} = $frequency{$a} } keys %frequency) {
print $frequency{$stem}\t$stem\n;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2013-03-19 Thread Michael Meeks
 scripts/annotate.pl |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 0dfe7ff61bdeceb8a266139d8908a62a57b96079
Author: Michael Meeks michael.me...@suse.com
Date:   Tue Mar 19 11:02:56 2013 +

another contiguity metric.

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 2ac2d6c..8bcad14 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -102,7 +102,11 @@ sub dump_breakdown($)
 my $annotated = 0;
 my %frequency;
 my $contiguous = 0;
+my $contiguous_limit = 0;
 my $in_start_run = 1;
+my $in_start_limit_run = 1;
+my $in_start_limit_max = 5;
+my $in_start_limit = $in_start_limit_max;
 for my $rev (reverse @{$revs}) {
if($rev-{note} ne ) {
my $stem = $rev-{note};
@@ -113,8 +117,14 @@ sub dump_breakdown($)
$frequency{$stem}++;
$annotated++;
$contiguous++ if ($in_start_run);
+   $contiguous_limit++ if ($in_start_limit_run);
} else {
$in_start_run = 0;
+   if ($in_start_limit  0) {
+   $in_start_limit--;
+   } else {
+   $in_start_limit_run = 0;
+   }
}
 }
 
@@ -122,7 +132,8 @@ sub dump_breakdown($)
 for my $stem (sort { $frequency{$b} = $frequency{$a} } keys %frequency) {
print $frequency{$stem}\t$stem\n;
 }
-print contiguous annotations: $contiguous\n;
+print contiguous annotations: $contiguous - contiguous\n;
+print contiguous tolerating $in_start_limit_max missing: 
$contiguous_limit\n;
 }
 
 sub sanity_check_revs($$)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2013-03-08 Thread Michael Meeks
 scripts/annotate.pl |   12 
 1 file changed, 12 insertions(+)

New commits:
commit a3441c4c5f89d99ec80b74c021ae735d80b6fb82
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Mar 8 15:51:02 2013 +

check it is a valid hash to annotate.

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 5b7ff66..2ac2d6c 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -144,6 +144,17 @@ sub sanity_check_revs($$)
 }
 }
 
+# ensure the hash we're annotating is in the right tree
+sub check_hash_for_note($$)
+{
+my ($git_dir, $hash) = @_;
+my $revs = read_log($git_dir);
+for my $rev (@{$revs}) {
+   return if ($rev-{hash} eq $hash);
+}
+die Unknown hash '$hash' - did you get your hashes the wrong way around 
?;
+}
+
 sub usage()
 {
 print STDERR Usage: aoo-annotate.pl [args] [--git /path/to/git] ['merged 
as: 1234' hash]\n;
@@ -211,6 +222,7 @@ if (!$list  !$stats  !$fetch) {
 validate_git_hash($note_hash) ||
die Hash on master '$note_hash' doesn't look like a git hash\n;
 
+check_hash_for_note($git_dir, $note_hash);
 fetch_git_notes($git_dir);
 `( cd '$git_dir' ; git --no-pager notes add -m '$note_text' $note_hash )`;
 push_git_notes($git_dir);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2013-03-06 Thread Caolán McNamara
 scripts/annotate.pl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 788a2f7e386ee409d48a35cb9cac3ae8fa8c4853
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Mar 6 10:03:39 2013 +

allow annotate.pl --fetch to work

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index c2529ef..5b7ff66 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -199,7 +199,7 @@ if (!defined $git_dir) {
 chomp ($git_dir);
 }
 
-if (!$list  !$stats) {
+if (!$list  !$stats  !$fetch) {
 
 print $note_text' '$note_hash\n;
 if (!defined $note_text || !defined $note_hash) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl

2013-03-05 Thread Caolán McNamara
 scripts/annotate.pl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 034121a1c0a41004a903e2db5b2dd3d2321d3da5
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 1 13:01:51 2013 +

allow 'merged as:' as note prefix

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 885d4ad..c2529ef 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -40,7 +40,7 @@ sub validate_git_hash($)
 sub validate_check_note($)
 {
 my $note_text = shift;
-$note_text =~ m/^(\S+):\s+(.+)$/ || die note: '$note_text' is missing a 
explanation: reason;
+$note_text =~ m/^(\S.+):\s+(.+)$/ || die note: '$note_text' is missing a 
explanation: reason;
 my $reason = $1;
 my $expl = $2;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: scripts/annotate.pl scripts/headerize.pl

2013-03-04 Thread Michael Meeks
 scripts/annotate.pl  |7 +
 scripts/headerize.pl |  219 +++
 2 files changed, 224 insertions(+), 2 deletions(-)

New commits:
commit 3b157637dad5774879e513bac23abaa006b638c5
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Mar 1 17:43:07 2013 +

update note fetching, and add header tool.

diff --git a/scripts/annotate.pl b/scripts/annotate.pl
index 9fe42e4..885d4ad 100755
--- a/scripts/annotate.pl
+++ b/scripts/annotate.pl
@@ -135,8 +135,11 @@ sub sanity_check_revs($$)
$note_count++ if ($note ne );
 }
 if ($note_count  100) {
-   print STDERR It looks as if you have not fetched your git notes please 
do\n;
-   print STDERR ( cd $git_dir ; git fetch origin 
refs/notes/commits:refs/notes/commits )\n;
+   print STDERR It looks as if you have not fetched your git notes please 
add the -f parameter to do that, or in extremis do:\n;
+   print STDERR (cd '$git_dir'; git --no-pager fetch -f origin 
refs/notes/commits:refs/notes/commits)\n;
+   print STDERR attempting to fetch notes for you ...\n;
+   fetch_git_notes($git_dir);
+   print STDERR exiting, re-start me ...\n;
exit 1;
 }
 }
diff --git a/scripts/headerize.pl b/scripts/headerize.pl
new file mode 100755
index 000..97c16e6
--- /dev/null
+++ b/scripts/headerize.pl
@@ -0,0 +1,219 @@
+#!/usr/bin/perl -w
+
+#
+# Tool for prepending an MPLv2 header to an existing ALv2
+# licensed module; must only be used on ALv2 licensed code.
+# pipe a list of files to update into this tool.
+#
+
+use strict;
+
+my $dry_run = 0;
+my $headerize = 0;
+
+my $header_string =
+'* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*
+* This file incorporates work covered by the following license notice:
+*
+*   Licensed to the Apache Software Foundation (ASF) under one or more
+*   contributor license agreements. See the NOTICE file distributed
+*   with this work for additional information regarding copyright
+*   ownership. The ASF licenses this file to you under the Apache
+*   License, Version 2.0 (the License); you may not use this file
+*   except in compliance with the License. You may obtain a copy of
+*   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+';
+
+sub emit_header($$)
+{
+my ($file, $fmt) = @_;
+print $file $fmt-{pre} . \n;
+my $header = $header_string;
+$header =~ s/\*/$fmt-{comment}/g;
+print $file $header;
+print $file $fmt-{post} . \n;
+}
+
+my %idl = (
+ext= qr/\.idl$/,
+start_re   = '^\s*\/\*{10,}',
+end_re = '^\s*\*\s*\*{10,}.*\*\/',
+pre= '/*',
+comment= ' *',
+post   = ' */',
+in_n_lines = 5,
+bin_utf8   = 1,
+);
+
+my %cplus_plus = (
+ext= qr/\.[ch]$/,
+ext2   = qr/\.[ch]xx$/,
+ext3   = qr/\.[sh]rc$/,
+ext4   = qr/\.sdi$/,
+ext5   = qr/\.java$/,
+ext6   = qr/\.idl$/,
+ext7   = qr/\.ulf$/,
+ext8   = qr/\.[ch]pp$/,
+ext9   = qr/\.inc$/,
+ext10  = qr/\.s$/,
+ext11  = qr/\.cs$/,
+ext12  = qr/\.y$/,
+ext13  = qr/\.mm$/,
+ext14  = qr/verinfo\.rc$/,
+ext15  = qr/\.cc$/,
+ext16  = qr/\.css$/,
+start_re   = '^\s*\/\*{10,}',
+end_re = '^\s*\*\s*\*{10,}.*\*\/',
+pre= '/*',
+comment= ' *',
+post   = ' */',
+in_n_lines = 5,
+bin_utf8   = 1,
+);
+
+my @formats = ( \%cplus_plus, \%idl );
+
+sub find_format($)
+{
+my $fname = shift;
+for my $fmt (@formats) {
+   # try to match all 'ext' prefixed keys
+   for my $extkey (keys %{$fmt}) {
+   $extkey =~ m/^ext/ || next;
+   my $re = $fmt-{$extkey};
+#  print STDERR match '$fname' vs '$re'\n;
+   return $fmt if ($fname =~ m/$re/);
+   }
+}
+#print STDERR no match\n;
+my $undefined;
+return $undefined;
+}
+
+while (my $arg = shift @ARGV) {
+if ($arg eq '--dry-run') {
+   $dry_run = 1;
+} elsif ($arg eq '--headerize') {
+   $headerize = 1;
+} else {
+   die unknown arg $arg;
+}
+}
+
+# Read filenames from stdin and re-write headers for re-based files
+my $cwd = `pwd`;
+chomp ($cwd);
+
+while (STDIN) {
+my $fname = $_;
+chomp ($fname);
+$fname =~ /^\s*$/  next;
+$fname =~ /^#/  next; # comment
+$fname = $cwd/$fname; # qualify the path
+
+my $fmt = find_format ($fname);
+if (!defined $fmt) {
+   print STDERR $fname:0:0 warning: unknown format\n if 
(!has_license($fname));
+   next;
+}
+my $start_re = qr/$fmt-{'start_re'}/;
+my $end_re = qr/$fmt-{'end_re'}/;
+
+my ($in, $out);
+
+open ($in, $fname) || die can't open $fname: $!;
+if ($dry_run) {
+   open ($out, , /dev/null);
+