From dcd2150c95518fe24ab1b5c65801f7fd464dc62c Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 19 Jun 2013 10:21:23 -0300 Subject: [PATCH] Update taggit --- taggit | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/taggit b/taggit index d67e206..c1d8adc 100644 --- a/taggit +++ b/taggit @@ -8,23 +8,27 @@ if [ "$MAKETAG" == "false" ]; then fi if [ ! -f version ]; then - ${dirname $BASH_SOURCE)/genversion > version + $(dirname $BASH_SOURCE)/genversion > version fi . ~/.buildtoolsrc -git pull +. version + +WHOLETAG="${VERSIONERS_TAGBASE}${SEP}${MAJOR}${SEP}${BUILD}" + +git fetch --tags TAGSHA1=$(git rev-list $TAG | head -n 1) if [ $REBUILDING -eq 0 ]; then echo "This is a rebuild of a previous tag, not tagging or pushing" >&2 -elif [ "$TAGSHA1" != "" ] && [ "$TAGSHA1" != "$SHA1" ]; then - echo "Someone else tagged my buildnumber (branch|${MAJOR}|${BUILD}) onto $TAGSHA1, while I built it from $SHA1 ... "'Help!' >&2 +elif [ "$(git tag | grep $WHOLETAG)" != "" ] && [ "$TAGSHA1" != "" ] && [ "$TAGSHA1" != "$SHA1" ]; then + echo "Someone else tagged my buildnumber (${WHOLETAG}) onto $TAGSHA1, while I built it from $SHA1 ... "'Help!' >&2 exit 1 elif [ "$TAGSHA1" != "" ] && [ "$TAGSHA1" == "$SHA1" ]; then echo "Someone else built this version at the same time I did, and we both tagged the same SHA1 with the same build tag. Not pushing my tag." else - git tag -f -a "${VERSIONERS_TAGBASE}${SEP}${MAJOR}${SEP}${BUILD}" $SHA1 + git tag -f -a "${WHOLETAG}" -m "Tagging for ${MAJOR}-${BUILD}" $SHA1 if [ "$PUSHTAG" != "false" ]; then - git push --tags + git push --tags fi fi