Use "git describe" in generating build signatures
authorH. Peter Anvin <hpa@zytor.com>
Tue, 15 Jul 2008 23:06:14 +0000 (16:06 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 15 Jul 2008 23:06:14 +0000 (16:06 -0700)
We got rid of the 10-character limitation a long time ago, so we might
as well use "git describe" in generating the build signatures.

gen-id.sh

index 02be21a..c8f8979 100755 (executable)
--- a/gen-id.sh
+++ b/gen-id.sh
@@ -6,12 +6,10 @@
 #
 
 if test -n "$GIT_DIR" -o -d ../.git -o -f ../.git; then
-    ver="$(git rev-parse HEAD | cut -c1-8)"
+    ver="$(git describe | cut -d- -f3-)"
     if test -n "$ver"; then
        if test -n "$(git diff-index --name-only HEAD)"; then
-           ver='g*'"$ver"
-       else
-           ver='g-'"$ver"
+           ver="${ver}"\*
        fi
     fi
 fi