summaryrefslogtreecommitdiffstats
path: root/git-version-gen
diff options
context:
space:
mode:
Diffstat (limited to 'git-version-gen')
-rwxr-xr-xgit-version-gen15
1 files changed, 15 insertions, 0 deletions
diff --git a/git-version-gen b/git-version-gen
new file mode 100755
index 0000000..6feac34
--- /dev/null
+++ b/git-version-gen
@@ -0,0 +1,15 @@
+#!/bin/sh
+SRCDIR=`dirname $0`
+if test -n "$1"; then
+ VER=$1
+else
+ if test -d "${SRCDIR}/.git" && test -x "`which git`" ; then
+ git update-index -q --refresh
+ VER=`git describe --tags --always --dirty=-dirty`
+ else
+ if test -f "${SRCDIR}/.tarball-version"; then
+ VER=`cat "${SRCDIR}/.tarball-version"`
+ fi
+ fi
+fi
+printf %s "$VER"