diff --git a/Makefile b/Makefile
index 5d35dcc..2126e44 100644
--- a/Makefile
+++ b/Makefile
@@ -62,7 +62,7 @@ test: $(unittests)
check_version:
@if [ "$(READ_VERSION)" != "$(CODE_VERSION)" ]; then \
- echo "Error: read-version version $(READ_VERSION)" \
+ echo "Error: read-version version '$(READ_VERSION)'" \
"not equal to code version $(CODE_VERSION)"; exit 2; \
else true; fi
diff --git a/tools/read-version b/tools/read-version
index c10f9b4..7478d3b 100755
--- a/tools/read-version
+++ b/tools/read-version
@@ -56,7 +56,7 @@ if os.path.isdir(os.path.join(_tdir, ".git")) and which("git"):
flags = []
if use_tags:
flags = ['--tags']
- cmd = ['git', 'describe'] + flags
+ cmd = ['git', 'describe', '--match=[0-9].*'] + flags
version = tiny_p(cmd).strip()