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 <alexhenrie24@gmail.com>
This commit is contained in:
Alex Henrie 2024-01-10 20:00:34 -07:00
parent 4c93e63ddf
commit 213237dd3a

View file

@ -43,7 +43,7 @@ pkgver() {
printf "r%s" "$(bzr revno)" printf "r%s" "$(bzr revno)"
# Git, tags available # 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 # Git, no tags available
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"