gnucash maint: Improve filtering in git-release-notes.pl

John Ralls jralls at code.gnucash.org
Fri Mar 26 14:01:31 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/2d456913 (commit)
	from  https://github.com/Gnucash/gnucash/commit/76a4389a (commit)



commit 2d456913f80dca28c3bacb61d65e96c013aec962
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Mar 26 10:45:11 2021 -0700

    Improve filtering in git-release-notes.pl
    
    Find and aggregate all translation commits to the program,
    ignoring those to the glossary and summary-only non-translation L10N items.
    Ignore summary-only merge commits.

diff --git a/util/git-release-notes.pl b/util/git-release-notes.pl
index 013e9511a..dc46f6307 100755
--- a/util/git-release-notes.pl
+++ b/util/git-release-notes.pl
@@ -72,7 +72,7 @@ my $repo = Git->repository(Directory => getcwd);
 $repo->command('describe') =~ m/(^[.\d]+)/;
 my $tag = $1 or die "Unable to determine tag";
 
-my (@bugs, @improves);
+my (@bugs, @improves, %l10n);
 my ($revs, $c) = $repo->command_output_pipe('log', '--topo-order', '--format=%s<|>%b<|>%N<{}>', "$tag..HEAD");
 my $item = "";
 while(<$revs>) {
@@ -85,12 +85,22 @@ while(<$revs>) {
         if ($item =~ m/^[\s\[]*[Bb]ug[\]\s:\-\#]*[0-9]+/) {
             $item =~ s/^[\s\[]*[Bb]ug[\]\s:\-\#]*([0-9]+)[ -]*/Bug $1 - /;
             push @bugs, $item;
+        } elsif ($item =~ m/^[Ll]10[Nn]:([a-z]{2}(?:[-_][A-Z]{2})?)/) {
+            $l10n{$1}++ unless ($item =~ /glossary/i);
+        }elsif ($item =~ m/^Translation/) {
+            if ($item =~ m[GnuCash/Program \(([[:alpha:] ]+)\)]) {
+                $l10n{$1}++;
+            }
+        } elsif ($item =~ m/^(?:Merge|[Ll]1[08][Nn]|[Ii]1[08][Nn])/) {
+            my ($sum, $desc, $notes) = split('\<\|\>', $item);
+            push @improves, $item if ($desc || $notes);
         } else {
             push @improves, $item;
         }
         $item = '';
     }
 }
+
 $repo->command_close_pipe($revs, $c);
 
 print "\nThe following bugs have been fixed:\n";
@@ -103,6 +113,8 @@ foreach my $other (@improves) {
     text_format($other, '    ', '      ');
 }
 
+print "\nNew and Updated Translations: ", join(", ", keys(%l10n)), "\n\n";
+
 print "*****HTML OUTPUT*****\n\n";
 print "<h6>Between $tag and XXX, the following bugfixes were accomplished:</h6>\n<ul>\n";
 foreach my $bug (sort @bugs) {
@@ -113,3 +125,4 @@ foreach my $other (@improves) {
     html_format_other($other);
 }
 print "</ul>\n";
+print "<p>New and Updated Translations: ", join(", ", sort(keys(%l10n))), "</p>\n";



Summary of changes:
 util/git-release-notes.pl | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list