Skip to content

Commit

Permalink
Added branch name to version string
Browse files Browse the repository at this point in the history
  • Loading branch information
mwatts15 committed Feb 20, 2015
1 parent f80f742 commit 3de9e03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ tests/test_sql
*.gcno
test-coverage
mount*
version.h
8 changes: 7 additions & 1 deletion get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ 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
break
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

0 comments on commit 3de9e03

Please sign in to comment.