proto: Strip initial "v" from Git tag names

Many projects use tags that are the version number prefixed with "v". In
particular, GitHub suggests and encourages this naming convention.
Include code in the example to remove the "v" so that the VCS package
version number is comparable to the regular package version number.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
This commit is contained in:
Alex Henrie 2024-01-10 20:09:19 -07:00
parent 213237dd3a
commit 7c60bd841a

View file

@ -43,7 +43,7 @@ pkgver() {
printf "r%s" "$(bzr revno)"
# Git, tags available
printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
printf "%s" "$(git describe --tags --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g;s/^v//')"
# Git, no tags available
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"