From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH OSSTEST] mg-list-all-branches: Sort branches according to any embedded version
Date: Mon, 13 Jul 2015 09:13:06 +0100 [thread overview]
Message-ID: <1436775186-5808-1-git-send-email-ian.campbell@citrix.com> (raw)
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 <ian.campbell@citrix.com>
---
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
next reply other threads:[~2015-07-13 8:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 8:13 Ian Campbell [this message]
2015-07-16 16:17 ` [PATCH OSSTEST] mg-list-all-branches: Sort branches according to any embedded version Ian Jackson
2015-07-16 16:24 ` Ian Campbell
2015-07-16 16:27 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436775186-5808-1-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.