]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
git-version-gen: port better to older Git
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Aug 2017 16:21:05 +0000 (09:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Aug 2017 16:21:35 +0000 (09:21 -0700)
Work even if the hash contains more than 4 digits.

build-aux/git-version-gen

index 6c054b4881a0ba8b2cd44a232fd72197f0b7cba7..e6c329d10f96624ef10bf12c1845d4af325b1596 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2017-08-06.05; # UTC
+scriptversion=2017-08-06.16; # UTC
 
 # Copyright (C) 2007-2017 Free Software Foundation, Inc.
 #
@@ -167,9 +167,9 @@ then
     # tag or the previous older version that did not?
     #   Newer: v6.10-77-g0f8faeb
     #   Older: v6.10-g0f8faeb
-    case $v in
-        *-*-g????) : git describe is okay three part flavor ;;
-        *-g????)
+    case ${v#-g*} in
+        *-*) : git describe is probably okay three part flavor ;;
+        *)
             : git describe is older two part flavor
             # Recreate the number of commits and rewrite such that the
             # result is the same as if we were using the newer version