There's no point in having a v in the default version only to be removed. The only time we need to remove the v is from `git describe`. Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx> --- GIT-VERSION-GEN | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 0eaa813cca..40502363dd 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.40.GIT +DEF_VER=2.40.GIT describe () { git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' @@ -15,11 +15,10 @@ then elif test -d "${GIT_DIR:-.git}" -o -f .git then VN=$(describe) + VN=${VN#v} fi : "${VN:=$DEF_VER}" -VN=${VN#v} - test -r $GVF && test "GIT_VERSION = $VN" = "$(cat $GVF)" && exit echo "GIT_VERSION = $VN" | tee $GVF >&2 -- 2.40.0+fc1