From 1d8fb7871b8816db3e34f7d793ef448a3b4d55a1 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 11 Oct 2009 17:00:22 -0700 Subject: [PATCH] cola.version: Pass --match when using git-describe This ensures that we only find tags matching the v$VERSION major.minor.micro.patch naming convention. Signed-off-by: David Aguilar --- cola/version.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cola/version.py b/cola/version.py index 75887167..da6e39db 100644 --- a/cola/version.py +++ b/cola/version.py @@ -35,7 +35,10 @@ class VersionUnavailable(Exception): def git_describe_version(): """Inspect the cola git repository and return the current version.""" try: - v = git.Git.execute(['git', 'describe', '--tags', '--abbrev=4'], + v = git.Git.execute(['git', 'describe', + '--tags', + '--match=v*', + '--abbrev=7'], with_stderr=True) except errors.GitCommandError, e: raise VersionUnavailable(str(e)) @@ -53,8 +56,8 @@ def git_describe_version(): def builtin_version(): """Return the builtin version or throw a VersionUnavailable exception""" try: - import builtin_version as bv - except ImportError: + from cola import builtin_version as bv + except ImportError, e: raise VersionUnavailable() else: return bv.version -- 2.11.4.GIT