osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13386


Change subject: osmocom-list-commits.sh: fix sorting release tags
......................................................................

osmocom-list-commits.sh: fix sorting release tags

Properly sort "git ls-remote" output, which looks like:
352f32c9cffef2e5df99cd2f03368dc56c99ee23        refs/tags/0.4.0

Use / as field separator and field no 3, instead of assuming that the
string gets split automatically after the tab character (which it does
not).

Use -V (version sort) instead of numeric sort.

Change-Id: I334e684ac5109fc289b68af78165862148074ea7
---
M scripts/osmocom-list-commits.sh
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/86/13386/1

diff --git a/scripts/osmocom-list-commits.sh b/scripts/osmocom-list-commits.sh
index d8183c6..886cb03 100755
--- a/scripts/osmocom-list-commits.sh
+++ b/scripts/osmocom-list-commits.sh
@@ -54,7 +54,7 @@
        # ...
        ret="$(git ls-remote --tags "$URL/$1")"
        ret="$(echo "$ret" | grep 'refs/tags/[0-9.]*$' || true)"
-       ret="$(echo "$ret" | sort -n -k2)"
+       ret="$(echo "$ret" | sort -V -t/ -k3)"
        ret="$(echo "$ret" | tail -n 1)"

        if [ -n "$ret" ]; then

--
To view, visit https://gerrit.osmocom.org/13386
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I334e684ac5109fc289b68af78165862148074ea7
Gerrit-Change-Number: 13386
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to