From 5f9da269510ea81bc346aba7364dc39f5e42a5fd Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Sat, 29 Apr 2017 18:54:16 +0200 Subject: lo-commit-stat: improve sort in buglists (by number within a tracker) Change-Id: I8eb5a3d3141fcc76bf5caffe0a7b30d5ec2b0c8c (cherry picked from commit 0b8cccdc20f7e9209de406ee1ec01aec8bfafceb) --- bin/lo-commit-stat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/lo-commit-stat b/bin/lo-commit-stat index ca3aa638644b..4ad9f013935f 100755 --- a/bin/lo-commit-stat +++ b/bin/lo-commit-stat @@ -402,7 +402,9 @@ sub print_bugs($$$$) { my ($pbugs, $log, $wiki) = @_; - foreach my $bug ( sort { $a cmp $b } keys %{$pbugs}) { + # sort alphabetically by bugzilla-type, but whithin that numerically + foreach my $bug ( sort { ($a =~ /(\D+)/)[0] cmp ($b =~ /(\D+)/)[0] || + ($a =~ /(\d+)/)[0] <=> ($b =~ /(\d+)/)[0] } keys %{$pbugs}) { my $summary = $pbugs->{$bug}{'summary'}; my $authors = ""; -- cgit v1.2.3