From 09ea9a166f988fdc784727a3f0134b854960a221 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 18 Dec 2018 12:14:47 +0000 Subject: [PATCH] More tweaks to semver --- contrib/semver/version.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/semver/version.sh b/contrib/semver/version.sh index 2b3c4bc3..03b5da2c 100644 --- a/contrib/semver/version.sh +++ b/contrib/semver/version.sh @@ -52,8 +52,8 @@ else fi # Get the number of merges on the current branch since the last tag -TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" 2>/dev/null) -BUILD=$(git rev-list $TAG..$BRANCH --count) +TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" --first-parent master 2>/dev/null) +BUILD=$(git rev-list $TAG.. --count) # Add the build tag on non-master branches if [ $BRANCH != "master" ]; then @@ -62,6 +62,6 @@ if [ $BRANCH != "master" ]; then fi else if [ $BUILD != 0 ]; then - printf -- "-%d" "$BUILD" + printf -- "-%d" "$(($BUILD+1))" fi fi