From a22da8009ff2057332d5cd4dbd9c08e601dcd5be Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 17 Dec 2018 22:07:28 +0000 Subject: [PATCH] Hopefully fix semver versioning breakage caused by non-master merge commits --- contrib/semver/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/semver/version.sh b/contrib/semver/version.sh index 331046f3..a53ed32c 100644 --- a/contrib/semver/version.sh +++ b/contrib/semver/version.sh @@ -10,7 +10,7 @@ TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.0" 2>/dev/null) MERGE=$(git rev-list $TAG..master --grep "from $DEVELOPBRANCH" 2>/dev/null | head -n 1) # Get the number of merges since the last merge to master -PATCH=$(git rev-list $TAG..master --count --merges --grep="from $DEVELOPBRANCH" 2>/dev/null) +PATCH=$(git rev-list $TAG..master --count --merges --grep="from $DEVELOPBRANCH" --first-parent master 2>/dev/null) # Decide whether we should prepend the version with "v" - the default is that # we do because we use it in git tags, but we might not always need it