Change in ...osmo-ci[master]: common.sh: osmo_git_last_commits_tags: add "all"

osmith gerrit-no-reply at lists.osmocom.org
Tue Jul 2 11:56:02 UTC 2019


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/14649


Change subject: common.sh: osmo_git_last_commits_tags: add "all"
......................................................................

common.sh: osmo_git_last_commits_tags: add "all"

Allow printing all tags instead of only the N most recent ones.

Related: OS#3870
Change-Id: I684c6881915831b33b679e8ae873213beb034ab7
---
M scripts/common.sh
1 file changed, 4 insertions(+), 2 deletions(-)



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

diff --git a/scripts/common.sh b/scripts/common.sh
index 0a32c31..30ab53f 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -16,7 +16,7 @@
 # Print last tags and related commits for an Osmocom git repository, e.g.:
 # "ec798b89700dcca5c5b28edf1a1cd16ea311f30a        refs/tags/1.0.1"
 # $1: Osmocom repository
-# $2: amount of commit, tag pairs to print (default: 1)
+# $2: amount of commit, tag pairs to print (default: 1, set to "all" to print all)
 # $3: string to print when there are no tags (default: empty string)
 osmo_git_last_commits_tags() {
 	# git output:
@@ -31,7 +31,9 @@
 	ret="$(git ls-remote --tags "$OSMO_GIT_URL/$1")"
 	ret="$(echo "$ret" | grep 'refs/tags/[0-9.]*$' || true)"
 	ret="$(echo "$ret" | sort -V -t/ -k3)"
-	ret="$(echo "$ret" | tail -n "$2")"
+	if [ "$2" != "all" ]; then
+		ret="$(echo "$ret" | tail -n "$2")"
+	fi
 
 	if [ -n "$ret" ]; then
 		echo "$ret"

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/14649
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I684c6881915831b33b679e8ae873213beb034ab7
Gerrit-Change-Number: 14649
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190702/bbcff315/attachment.html>


More information about the gerrit-log mailing list