git-version: remove -g{sha} unconditionally

This commit is contained in:
Xi Ruoyao 2021-10-13 19:30:53 +08:00
parent 3d7b4f686a
commit 7af57d2e6f
No known key found for this signature in database
GPG Key ID: D95E4716CCBB34DC

View File

@ -48,11 +48,9 @@ esac
full_date="$month $day$suffix, $year"
sha="$(git describe --abbrev=1)"
if [ "$(git branch --show-current)" = "trunk" ]; then
sha=$(echo "$sha" | sed 's/-g[^-]*$//')
fi
version="$sha"
versiond="$sha-systemd"
rev=$(echo "$sha" | sed 's/-g[^-]*$//')
version="$rev"
versiond="$rev-systemd"
if [ "$(git diff HEAD | wc -l)" != "0" ]; then
version="$version+"