git » chasquid » commit b9c2ef6

Use `git describe --tags` to include non-annotated tags

author Alberto Bertogli
2022-09-04 12:10:07 UTC
committer Alberto Bertogli
2022-09-04 12:10:07 UTC
parent ddcfacccd009c7394e6a41593c4a6f699d90c1eb

Use `git describe --tags` to include non-annotated tags

By default, `git describe` uses only annotated tags. Since some may not
be annotated (like v1.10) this causes some scripts to pick a confusing
version identifier.

This patch fixes the issue by passing `--tags`, which means all tags
will be considered.

Makefile +1 -1
test/cover.sh +1 -1

diff --git a/Makefile b/Makefile
index 78f6375..7fa0605 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 
 ifndef VERSION
-    VERSION = `git describe --always --long --dirty`
+    VERSION = `git describe --always --long --dirty --tags`
 endif
 
 # https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal
diff --git a/test/cover.sh b/test/cover.sh
index c212c24..9479f49 100755
--- a/test/cover.sh
+++ b/test/cover.sh
@@ -56,7 +56,7 @@ go run "${UTILDIR}/coverhtml/coverhtml.go" \
 	-input="$COVER_DIR/all.out"  -strip=3 \
 	-output="$COVER_DIR/coverage.html" \
 	-title="chasquid coverage report" \
-	-notes="Generated at commit <tt>$(git describe --always --dirty)</tt> ($(git log -1 --format=%ci))"
+	-notes="Generated at commit <tt>$(git describe --always --dirty --tags)</tt> ($(git log -1 --format=%ci))"
 
 echo
 echo