From 213237dd3a6215bab7d301daf798f1d0b2153833 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Wed, 10 Jan 2024 20:00:34 -0700 Subject: [PATCH] proto: Consider lightweight Git tags when determining the version number By default, `git describe` only uses annotated tags. However, most projects use non-annotated or "lightweight" tags instead of annotated ones. Include the --tags flag in the example to consider all tag types. Signed-off-by: Alex Henrie --- proto/PKGBUILD-vcs.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/PKGBUILD-vcs.proto b/proto/PKGBUILD-vcs.proto index 49c6759f..c89bb50b 100644 --- a/proto/PKGBUILD-vcs.proto +++ b/proto/PKGBUILD-vcs.proto @@ -43,7 +43,7 @@ pkgver() { printf "r%s" "$(bzr revno)" # Git, tags available - printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" + printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" # Git, no tags available printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"