diff options
author | Korrawit Pruegsanusak <detective.conan.1412@gmail.com> | 2012-06-01 00:24:18 +0700 |
---|---|---|
committer | Korrawit Pruegsanusak <detective.conan.1412@gmail.com> | 2012-06-01 00:24:18 +0700 |
commit | f439d765a4d6c68e2a3ee524255161cd6b65355e (patch) | |
tree | 7e848bea259fbe882b30f1f9cea366432e8de7ab /bin/lo-commit-stat | |
parent | 6858c3eb53717cc312133646e6c621e7ca4956cf (diff) |
lo-commit-stat: lowercase first char if the word contains only lowercase chars
For Example:
* ScConditionalFormat -> no change
* SVG -> no change
* WaE -> no change
* Some -> some
After this change, we now have to sort case-insensitively,
or the lines starting with uppercase will clog up together.
Change-Id: If08cbaa19e6f3496dd1f07920464d16140e2aa3a
Diffstat (limited to 'bin/lo-commit-stat')
-rwxr-xr-x | bin/lo-commit-stat | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat index f1677b2e5d23..885d0534eda6 100755 --- a/bin/lo-commit-stat +++ b/bin/lo-commit-stat @@ -63,10 +63,12 @@ sub standardize_summary($) $line =~ s/^\s*//; $line =~ s/\s*$//; - # lower first letter - $line =~ m/(^.)/; - my $first_char = lc($1); - $line =~ s/^./$first_char/; + # lower first letter if the word contains only lowercase letter + if ( $line =~ m/(^.[a-z]+\b)/ ) { + $line =~ m/(^.)/; + my $first_char = lc($1); + $line =~ s/^./$first_char/; + } # FIXME: remove do at the end of line # remove bug numbers @@ -259,7 +261,7 @@ sub print_stat($$) my $old_summary=""; my %authors = (); my %bugs = (); - foreach my $id ( sort { $pdata->{$piece}{$a}{'summary'} cmp $pdata->{$piece}{$b}{'summary'} } keys %{$pdata->{$piece}}) { + foreach my $id ( sort { lc $pdata->{$piece}{$a}{'summary'} cmp lc $pdata->{$piece}{$b}{'summary'} } keys %{$pdata->{$piece}}) { my $summary = $pdata->{$piece}{$id}{'summary'}; if ($summary ne $old_summary) { print_summary_in_stat($old_summary, \$piece_title, \%bugs, \%authors, " + ", $log); |