瀏覽代碼

Make git return the last tag from git-describe

Bryan Drewery 6 年之前
父節點
當前提交
d3c6aae377
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Makefile.in
  2. 1 1
      build.sh

+ 1 - 1
Makefile.in

@@ -22,7 +22,7 @@ COMMIT_FULL 	:= $(shell git log -1 --pretty=format:%H HEAD)
 COMMIT_SHORT 	:= $(shell git log -1 --pretty=format:%h HEAD)
 BRANCH 		:= $(shell git branch --no-color | grep "^*" | sed -e 's/^\* //')
 BUILDTS 	:= $(shell git log -1 --pretty=format:%ct HEAD)
-VERSION 	:= $(shell git describe)
+VERSION 	:= $(shell git describe --candidates=2)
 DISTRIB = wraith-$(VERSION)
 
 HELPFILE = doc/help.txt

+ 1 - 1
build.sh

@@ -4,7 +4,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:${HOME}/bin
 
 if [ -d .git ]; then
   BUILDTS=$(git log -1 --pretty=format:%ct HEAD)
-  ver=$(git describe)
+  ver=$(git describe --candidates=2)
 else
   ver=$(awk '/^VERSION/ {print $3}' Makefile.in)
   BUILDTS=`grep -m 1 "BUILDTS = " Makefile.in | awk '{print $3}'`