+# Use a tag if what we've built is exactly on one
+version=$(git describe --tags --abbrev=0 --match=v2.*.* --exact-match $1 2> /dev/null)
+if [ "$?" != "0" ]; then
+ # Otherwise use <branch>-<commit>
+ version="$(basename $(git name-rev --name-only HEAD))-$(git rev-parse --short HEAD)"
+fi