From 3de9e030c92cce478e2698f2497ca90fd5db3d56 Mon Sep 17 00:00:00 2001 From: Mark Watts Date: Fri, 20 Feb 2015 10:36:36 -0600 Subject: [PATCH] Added branch name to version string --- .gitignore | 1 + get_version.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 128382f..3b8f70b 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ tests/test_sql *.gcno test-coverage mount* +version.h diff --git a/get_version.sh b/get_version.sh index 82f45d8..5edb34b 100755 --- a/get_version.sh +++ b/get_version.sh @@ -5,6 +5,8 @@ tag=`git tag --points-at $commit | head -n 1` if [ $tag ] ; then echo $tag else + branch=`git branch --list | grep '*' | tail -c +3` + for hist in `git log --format=%H`; do tag=`git tag --points-at $hist | head -n 1` if [ $tag ] ; then @@ -12,5 +14,9 @@ else fi done abbr_head=`echo $commit|head -c 7` - echo $tag+$abbr_head + if [ $branch != "master" ] ; then + echo $tag-$branch+$abbr_head + else + echo $tag+$abbr_head + fi fi