summaryrefslogtreecommitdiff
path: root/bin/lo-commit-stat
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.cz>2011-02-02 17:46:51 +0100
committerPetr Mladek <pmladek@suse.cz>2011-02-02 17:47:39 +0100
commit9a34f07bd932b2569895a9b6cc7d5248cdebd76c (patch)
treeb95f9a010f51df444bedfc1a9d15ce3c5ca78578 /bin/lo-commit-stat
parentbb5140dbb6622a3f579eecbcb46fbfb95d5ab183 (diff)
lo-commit-stat: really print the found bug numbers
Diffstat (limited to 'bin/lo-commit-stat')
-rwxr-xr-xbin/lo-commit-stat17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat
index aae7ce5cfac2..41e2e86805e3 100755
--- a/bin/lo-commit-stat
+++ b/bin/lo-commit-stat
@@ -17,13 +17,12 @@ sub search_bugs($$$$)
my $bug = "";
my $bug_orig;
- %{$pdata->{$piece}{$commit_id}{'bugs'}} = ();
while (defined $bug) {
# match fdo#123, rhz#123, i#123
if ( $line =~ m/(\w*\#+\d+)/ ) {
$bug_orig = $1;
$bug = $1;
- # match #i123#
+ # match #i123#
} elsif ( $line =~ m/(\#i)(\d+)(\#)/ ) {
$bug_orig = $1 . $2 . $3;
$bug = $2;
@@ -34,7 +33,7 @@ sub search_bugs($$$$)
$bug_orig =~ s/\#/\\#/;
$line =~ s/[Rr]esolves:\s*$bug_orig\s*//;
$line =~ s/\s*-\s*$bug_orig\s*//;
- $line =~ s/$bug_orig[:,]?\s*//;
+ $line =~ s/\(?$bug_orig\)?[:,]?\s*//;
%{$pdata->{$piece}{$commit_id}{'bugs'}} = () if (! defined %{$pdata->{$piece}{$commit_id}{'bugs'}});
$pdata->{$piece}{$commit_id}{'bugs'}{$bug} = 1;
$bug = undef;
@@ -78,14 +77,14 @@ sub load_git_log($$$$)
while (my $line = <GIT>) {
chomp $line;
- if ( $line =~ m/commit ([0-9a-z]{20})/ ) {
+ if ( $line =~ m/^commit ([0-9a-z]{20})/ ) {
$commit_id = "$1";
$summary=undef;
%{$pdata->{$piece}{"$commit_id"}} = ();
next;
}
- if ( $line =~ /Author:\s*([^\<]*)\<([^\>]*)>/ ) {
+ if ( $line =~ /^Author:\s*([^\<]*)\<([^\>]*)>/ ) {
# get rid of extra empty spaces;
my $name = "$1";
$name =~ s/\s+$//;
@@ -95,12 +94,12 @@ sub load_git_log($$$$)
$pdata->{$piece}{$commit_id}{'author'}{'email'} = "$2";
next;
}
-
- if ( $line =~ /Date:\s+/ ) {
+
+ if ( $line =~ /^Date:\s+/ ) {
# ignore date line
next;
}
-
+
if ( $line =~ /^\s*$/ ) {
# ignore empty line
next;
@@ -161,7 +160,7 @@ sub load_data($$$$)
sub print_summary_in_stat($$$$)
{
my ($summary, $pbugs, $pauthors, $prefix) = @_;
-
+
return if ( $summary eq "" );
my $bugs = "";