Cloudy & Associates

Commit fb668690 authored by Chatzikos, Marios's avatar Chatzikos, Marios
Browse files

Fix bug in gitversion.sh

When a release tag is cloned, the branch default to '(no branch)'.
The revision generated for the branch contains an unbalanced parenthesis
(i.e., it is "(no-c22.00"), which causes compilation to abort.

The present fix causes the revision on a cloned release tag to be, e.g.,
'c22.00'.

Recall, this appears in the first line of the main Cloudy output.

NB NB This patch has been independently applied to the release branch.
parent 9d622692
......@@ -15,9 +15,15 @@
#
branch=`git branch | grep '^\*' | awk '{ print $2 }'`
branch=`echo $branch | sed 's/(no//'`
tag=`git describe --tags --abbrev=0 2> /dev/null`
if [ -z "$tag" ]; then
tag=`git log --oneline | head -n 1 | awk '{print $1}'`
fi
[[ -z "`git status -s -uno`" ]] && modified="" || modified="-modified"
echo $branch-$tag$modified
if [ -z "$branch" ];
then
echo $tag$modified
else
echo $branch-$tag$modified
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment