summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-04-29 19:15:26 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-04-29 19:18:50 +0200
commit249b6a552b00637ae7ad3dcb8d797befba1734ad (patch)
treec4eecfe5a977b3807f57c6edd86096a7db12dcb0 /bin
parent0b8cccdc20f7e9209de406ee1ec01aec8bfafceb (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
Diffstat (limited to 'bin')
-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;
}