From 10b489082776fd48b26e317bdee4eb2ecb4d2a18 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 1 Apr 2013 20:30:35 +0700 Subject: [PATCH] Fix #275, close #297 --- version.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/version.sh b/version.sh index 33aa95a5..5dde761d 100755 --- a/version.sh +++ b/version.sh @@ -16,11 +16,21 @@ else COMMITS_SINCE=`${GIT} log --format=oneline ${LATEST_TAG}..HEAD | wc -l` SHORT_ID=`${GIT} rev-parse --short HEAD` - # If this commit is tagged, don't print anything - # (the assumption here is: this is a release) if [ "x$COMMITS_SINCE" = "x0" ] then - EXTRA="" + if [ "x$LATEST_TAG" = "x" ] + then + if [ "x$SHORT_ID" = "x" ] + then + EXTRA="" + else + EXTRA="-git-${SHORT_ID}" + fi + else + # If this commit is tagged, don't print anything + # (the assumption here is: this is a release) + EXTRA="" + fi else EXTRA="-git-${COMMITS_SINCE}-${SHORT_ID}" fi