summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-04-29 19:15:26 +0200
committerAndras Timar <andras.timar@collabora.com>2017-08-04 12:05:09 +0200
commit65b77bc45799c32d969debc2365d4e1aaacd5479 (patch)
tree15775fd0ad86288063993837f3d3ddb752be0587
parent991deefd33572202a3d0f1f324c7c7ec4f063f82 (diff)
lo-commit-stat: use matching group before destroying it with another match
it also doesn't make sense to numerically compare a %hash enable warnings in the script and remove a duplicated variable (and some unnecessary hash-declarations) Change-Id: I0a84dc28f369931ee31a1cf12849fde2b63f1ca2 (cherry picked from commit 249b6a552b00637ae7ad3dcb8d797befba1734ad) (cherry picked from commit 7193a4a1a0df775a0eb2ef222871d46b3c8b92b0)
-rwxr-xr-xbin/lo-commit-stat16
1 files changed, 7 insertions, 9 deletions
diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index 4ad9f013935f..2e42d468b40d 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -4,6 +4,7 @@
#!/usr/bin/perl
use strict;
+use warnings;
use LWP::UserAgent;
use utf8;
use File::Temp;
@@ -157,26 +158,24 @@ sub load_git_log($$$$$$$)
# }
open (GIT, "$cmd 2>&1|") || die "Can't run $cmd: $!";
- %{$pdata->{$module}} = ();
while (my $line = <GIT>) {
chomp $line;
if ( $line =~ m/^commit ([0-9a-z]{20})/ ) {
- $commit_id = "$1";
+ $commit_id = $1;
$summary=undef;
- %{$pdata->{$module}{"$commit_id"}} = ();
next;
}
if ( $line =~ /^Author:\s*([^\<]*)\<([^\>]*)>/ ) {
# get rid of extra empty spaces;
- my $name = "$1";
+ my $name = $1;
+ my $email = $2;
$name =~ s/\s+$//;
die "Error: Author already defined for the commit {$commit_id}\n" if defined ($pdata->{$module}{$commit_id}{'author'});
- %{$pdata->{$module}{$commit_id}{'author'}} = ();
- $pdata->{$module}{$commit_id}{'author'}{'name'} = "$name";
- $pdata->{$module}{$commit_id}{'author'}{'email'} = "$2";
+ $pdata->{$module}{$commit_id}{'author'}{'name'} = $name;
+ $pdata->{$module}{$commit_id}{'author'}{'email'} = $email;
next;
}
@@ -506,7 +505,6 @@ my $branch_name;
my $git_command = "git log";
my $git_cherry;
my $git_args = "";
-my $branch_name;
my %data;
my %bugs = ();
@@ -555,7 +553,7 @@ foreach my $arg (@ARGV) {
}
# default log
-if (%generate_log == 0) {
+unless (%generate_log) {
$generate_log{"commits"} = 1;
}