summaryrefslogtreecommitdiffstats
path: root/tools/version.sh
diff options
context:
space:
mode:
authorMichael Hohmuth <sideral@rockbox.org>2011-05-06 08:36:10 +0000
committerMichael Hohmuth <sideral@rockbox.org>2011-05-06 08:36:10 +0000
commit7bac05c74954a10888b92754b51418c70bcd458a (patch)
treea91b1514a61c2efa17864a91c53d2ac1695996f3 /tools/version.sh
parentfcf51bcd9281f5ef10d695add002b2475e8316e6 (diff)
downloadrockbox-7bac05c74954a10888b92754b51418c70bcd458a.tar.gz
rockbox-7bac05c74954a10888b92754b51418c70bcd458a.tar.bz2
rockbox-7bac05c74954a10888b92754b51418c70bcd458a.zip
Better version reporting for git-tracked repositories: Include the git
commit ID in the version string, much like is done for repos tracked with bzr. FS#11297 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29827 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/version.sh')
-rwxr-xr-xtools/version.sh17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/version.sh b/tools/version.sh
index 484a33189c..04c7651192 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -43,16 +43,15 @@ gitversion() {
version=`git log --pretty=format:'%b' --grep='git-svn-id: svn' -1 | tail -n 1 | perl -ne 'm/@(\d*)/; print "r" . $1;'`
mod=""
# Is this a git-svn commit?
- if ! git log HEAD^.. --pretty=format:"%b" | grep -q "git-svn-id: svn" ; then
- mod="M"
+ if ! git log -1 --pretty=format:"%b" | grep -q "git-svn-id: svn" ; then
+ version="$version+$head"
+ fi
# Are there uncommitted changes?
- else
- export GIT_WORK_TREE="$1"
- if git diff --name-only HEAD | read dummy; then
- mod="M"
- elif git diff --name-only --cached HEAD | read dummy; then
- mod="M"
- fi
+ export GIT_WORK_TREE="$1"
+ if git diff --name-only HEAD | read dummy; then
+ mod="M"
+ elif git diff --name-only --cached HEAD | read dummy; then
+ mod="M"
fi
echo "${version}${mod}"