Use 'git describe --match' if present (added in git 1.5.5).
authorEric Blake <ebb9@byu.net>
Tue, 8 Apr 2008 13:38:18 +0000 (07:38 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 8 Apr 2008 17:26:12 +0000 (11:26 -0600)
* build-aux/git-version-gen: Limit result to tags that match 'v*'
if possible.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
build-aux/git-version-gen

index 0cb470d..3461092 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-08  Eric Blake  <ebb9@byu.net>
+
+       Use 'git describe --match' if present (added in git 1.5.5).
+       * build-aux/git-version-gen: Limit result to tags that match 'v*'
+       if possible.
+
 2008-04-08  Bruno Haible  <bruno@clisp.org>
 
        Add tentative support for OpenServer.
index 7aa0253..710870c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2008-04-03.22
+scriptversion=2008-04-08.07
 
 # Copyright (C) 2007-2008 Free Software Foundation
 #
@@ -95,7 +95,8 @@ if test -n "$v"
 then
     : # use $v
 elif test -d .git \
-    && v=`git describe --abbrev=4 HEAD 2>/dev/null` \
+    && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
+         || git describe --abbrev=4 HEAD 2>/dev/null` \
     && case $v in
         v[0-9]*) ;;
         *) (exit 1) ;;