From 2f4581665e8a6be7dc3a3a4bf0ab3980d722bef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Schaerer?= Date: Fri, 18 Nov 2011 14:25:54 +0100 Subject: [PATCH] avoid making the tag on the wrongly numbered autojump --- git-version.sh | 12 +++++++++--- make_release.sh | 10 +++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/git-version.sh b/git-version.sh index 61fe82b..3f359e0 100755 --- a/git-version.sh +++ b/git-version.sh @@ -7,8 +7,14 @@ then exit fi -gitrevision=`git describe` -if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then - gitrevision=$gitrevision"-dirty" +if [ -z "$1" ] +then + gitrevision=`git describe` + if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then + gitrevision=$gitrevision"-dirty" + fi +else + gitrevision="$1" fi + sed -i "s/^AUTOJUMP_VERSION = \".*\"$/AUTOJUMP_VERSION = \"$gitrevision\"/" autojump diff --git a/make_release.sh b/make_release.sh index 3ff9ab0..29caeff 100755 --- a/make_release.sh +++ b/make_release.sh @@ -8,9 +8,14 @@ then exit 1 fi version=$1 +tagname=release-${version} +./git-version.sh ${tagname} + +# Commit the version change +git commit autojump #Create tag -git tag -a release-${version} +git tag -a ${tagname} #check for tag existence git describe release-$1 2>&1 >/dev/null || @@ -19,5 +24,4 @@ git describe release-$1 2>&1 >/dev/null || exit 1 } -./git-version.sh -git archive --format=tar --prefix autojump_${version}/ release-${version} | gzip > autojump_${version}.tar.gz +git archive --format=tar --prefix autojump_${version}/ ${tagname} | gzip > autojump_${version}.tar.gz