From d750526dc71c6738f9070ada26e346f2973f9e17 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 15 Jun 2013 12:08:20 -0300 Subject: [PATCH] Support alternate separators for gitversion --- gitversion | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gitversion b/gitversion index 8080ac8..37695ea 100644 --- a/gitversion +++ b/gitversion @@ -1,10 +1,11 @@ #!/bin/bash LOGSPEC='%ci %an <%aE>%n%n %s%n [%h]%d%n' +VERSIONERS_SEPARATOR=${VERSIONERS_SEPARATOR:-,} BRANCH=$2 if [ "${BRANCH}" == "" ]; then - BRANCH=$(git branch | grep '^\*\s*.*' | cut -d ' ' -f 2) + BRANCH=$(git branch | grep '^\*\s*.*' | cut -d ' ' -f 2-) fi REBUILDING=0 @@ -18,8 +19,8 @@ if [ "$TAG" == "" ]; then REBUILDING=1 MAJOR=$BRANCH else - MAJOR=$(echo $TAG | cut -d , -f 2) - BUILD=$(echo $TAG | cut -d , -f 3) + MAJOR=$(echo $TAG | cut -d ${VERSIONERS_SEPARATOR} -f 2) + BUILD=$(echo $TAG | cut -d ${VERSIONERS_SEPARATOR} -f 3) if [ "$TAGSHA" != "$SHA1" ]; then CHANGELOG="$(git log --format="format:$LOGSPEC" $TAGSHA..$SHA1)" BUILD=$(expr $BUILD + 1)