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 0cb470d127026eb30b0626f4b871c43df3fccc7e..3461092bf097a2ce1908995ab39ae088b1d5575d 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 7aa025365d1724c56029aaa680c9de78587af1ca..710870cdb92c46735f5f3cac59680c1621fb9572 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) ;;