summaryrefslogtreecommitdiffstats
path: root/version.sh
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-09 09:44:24 +0200
committerwm4 <wm4@nowhere>2013-08-09 09:44:24 +0200
commitb27f65a758a10e6a4742e44644c719786b999126 (patch)
tree2c21d3430cc707b0c14af0a7e6017328c3eb786f /version.sh
parentd8922361d147bfdc91cd9a09160b025d832a6b72 (diff)
downloadmpv-b27f65a758a10e6a4742e44644c719786b999126.tar.bz2
mpv-b27f65a758a10e6a4742e44644c719786b999126.tar.xz
version.sh: integrate the release tag in output
This is basically reconstructed from 46b218c. Since we now have proper release tags, we want this again. Add --tags to the git describe call, because the github release system creates light-weight tags only, and we're too lazy to create annitated tags (or is that bad practice?). Add --long, so that the git commit hash is part of the output even if the tag matches.
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/version.sh b/version.sh
index 90a08ac10e..31e929ff1c 100755
--- a/version.sh
+++ b/version.sh
@@ -7,13 +7,13 @@ test "$1" && extra="-$1"
# Extract revision number from file used by daily tarball snapshots
# or from "git describe" output
git_revision=$(cat snapshot_version 2> /dev/null)
-test $git_revision || test ! -e .git || git_revision=`git rev-parse --short HEAD`
+test $git_revision || test ! -e .git || git_revision=`git describe --match "v[0-9]*" --always --tags --long`
git_revision=$(expr "$git_revision" : v*'\(.*\)')
test $git_revision || git_revision=UNKNOWN
# releases extract the version number from the VERSION file
version=$(cat VERSION 2> /dev/null)
-test $version || version=git-$git_revision
+test $version || version=$git_revision
NEW_REVISION="#define VERSION \"${version}${extra}\""
OLD_REVISION=$(head -n 1 version.h 2> /dev/null)