@@ -17,7 +17,7 @@ then
# Handle an un-tagged repository
sha=$(git describe --abbrev=8 --always 2>/dev/null)
commits=$(git log --oneline | wc -l 2>/dev/null)
- version="v0.0.0-$commits-g$sha"
+ version="v0.0.0-$commits-$sha"
fi
# Append a '-dirty' suffix if the working tree is dirty. Prevent false
@@ -28,8 +28,8 @@ then
fi
git diff-index --quiet HEAD || version="$version-dirty ($(date --iso-8601=seconds))"
-# Replace first '-' with a '+' to denote build metadata, strip the 'g' in from
-# of the git SHA1 and remove the initial 'v'.
-version=$(echo "$version" | sed -e 's/-/+/' | sed -e 's/-g/-/' | cut -c 2-)
+# Replace first '-' with a '+' to denote build metadata, and remove the initial
+# 'v'.
+version=$(echo "$version" | sed -e 's/-/+/' | cut -c 2-)
echo "$version"
The 'g' version prefix, is added and then stripped. Prevent adding it in the first place, to simplify the implementation. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- utils/gen-version.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)