From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST] mg-list-all-branches: Sort branches according to any embedded version Date: Mon, 13 Jul 2015 09:13:06 +0100 Message-ID: <1436775186-5808-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Many of our branches include a version number, this change results in e.g. linux-3.0 < linux-3.4 < linux-3.10 rather than linux-3.0 < linux-3.10 < linux-3.4, which is more natural for uses such as ./mg-all-branch-statuses. Requires Sort::Versions (Debian package libsort-versions-perl). Signed-off-by: Ian Campbell --- mg-list-all-branches | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mg-list-all-branches b/mg-list-all-branches index c968a99..1549f81 100755 --- a/mg-list-all-branches +++ b/mg-list-all-branches @@ -3,6 +3,7 @@ # mentioned in cr-daily-branch or crontab use strict; +use Sort::Versions; our %branches; @@ -15,4 +16,4 @@ foreach my $f (qw(cr-for-branches crontab)) { close C or die $!; } -print $_,"\n" or die $! foreach sort keys %branches; +print $_,"\n" or die $! foreach sort { versioncmp($a, $b) } keys %branches; -- 2.1.4