summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Kuzminsky <seb@highlab.com>2011-12-14 20:44:44 -0700
committerSebastian Kuzminsky <seb@highlab.com>2011-12-15 09:21:59 -0700
commitf176b044930dec1cb22d64cb7fc590c79cd30485 (patch)
tree7c688d0045cbab3227fcc57fb320b23d6d59485c
parent8c09addcb26d7de151693d0fd0061dedf9c9b917 (diff)
downloadlinuxcnc-f176b044930dec1cb22d64cb7fc590c79cd30485.tar.gz
linuxcnc-f176b044930dec1cb22d64cb7fc590c79cd30485.zip
build system: make reasonable version numbers for unknown branches
The scripts/get-version-from-git script is used to produce a version number based on things like the current branch and most recent tag signed by the release managers. It used to fail completely on branches other than 2.4, 2.5, and master. This commit makes it do something hopefully reasonable on branches it doesn't know about: it uses the version from the VERSION file, plus "~", plus the branch name, plus another "~", plus the sha1 of the HEAD commit.
-rwxr-xr-xscripts/get-version-from-git3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/get-version-from-git b/scripts/get-version-from-git
index beaca1e55..a84da3a00 100755
--- a/scripts/get-version-from-git
+++ b/scripts/get-version-from-git
@@ -13,4 +13,7 @@ fi
githelper $1
git describe --match "$GIT_TAG"
+if [ $? -ne 0 ]; then
+ echo v$(git show HEAD:VERSION)~${GIT_BRANCH}~$(git log --pretty=format:%h HEAD~..HEAD)
+fi