ref: c435f06b308e52d7a5d2aad9eec98a1541832b47
parent: a32fa319d3e300d80df648e7edb2157b599003ab
author: Ralph Giles <[email protected]>
date: Tue Oct 1 09:05:33 EDT 2013
Pass --always to git describe. This generates a useful version string even for --depth=1 checkouts. The option was added in git v1.6.6.
--- a/update_version
+++ b/update_version
@@ -34,7 +34,8 @@
# -dirty from files that have been touched but are not actually altered in the
# working dir.
GIT_VERSION=$(cd "$SRCDIR" && git status > /dev/null 2>&1 \
- && git describe --tags --match 'v*' --dirty 2> /dev/null)
+ && git describe --tags --match 'v*' \
+ --always --dirty 2> /dev/null)
GIT_VERSION=${GIT_VERSION#v}
if [ -n "$GIT_VERSION" ]; then
--- a/win32/genversion.bat
+++ b/win32/genversion.bat
@@ -2,7 +2,7 @@
setlocal enableextensions enabledelayedexpansion
-for /f %%v in ('git --git-dir="%~dp0..\.git" describe --tags --match "v*"') do set version=%%v
+for /f %%v in ('git --git-dir="%~dp0..\.git" describe --tags --match "v*" --always --dirty') do set version=%%v
if not "%version%"=="" goto :gotversion
@@ -43,4 +43,4 @@
:exit
-del "%1_temp"
\ No newline at end of file
+del "%1_temp"