From 49152ad1189ce40c2629cab3236d968588b2fdb1 Mon Sep 17 00:00:00 2001 From: Karl Ramm Date: Sat, 5 Oct 2013 23:47:19 -0400 Subject: try to expose the branch name --- get_vers.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/get_vers.sh b/get_vers.sh index 7f281ae..c67a173 100755 --- a/get_vers.sh +++ b/get_vers.sh @@ -6,6 +6,15 @@ if test -f ${top_srcdir}/VERSION; then VERSION=`cat ${top_srcdir}/VERSION` elif test -d ${top_srcdir}/.git; then VERSION=`(cd $top_srcdir; git describe --abbrev=6 --dirty | sed -e 's/%7E/~/')` + + if test "$(git symbolic-ref HEAD)" != refs/heads/master; then + REF=$(git symbolic-ref --short HEAD) + if test "$REF" = "fatal: ref HEAD is not a symbolic ref"; then + VERSION="$VERSION: detached head" + else + VERSION="$VERSION $(echo $REF | tr 'a-z-' 'A-Z ')" + fi + fi fi if test -z "$VERSION"; then -- cgit v1.2.3