From: Felipe Contreras Date: Fri, 14 Apr 2023 12:18:41 GMT Subject: [PATCH 18/18] version-gen: generate proper interim versions Message-ID: <20230414121841.373980-19-felipe.contreras@gmail.com> In-Reply-To: <20230414121841.373980-1-felipe.contreras@gmail.com> The change from dashes to dots was done in 2006 to satisfy some RPM requirements: 5c7d3c9507 (Allow building of RPM from interim snapshot., 2006-01-16). This probably was done because `2.40.0-100-g000` would be interpreted as version `2.40.0` release `100`. It isn't clear because the commit message doesn't explain. But using a dot makes it worse because `2.40.0.n` will always be newer than `2.40.0-n`. What we want is an ordering such as: * 2.40.0 # git release * 2.40.0+100-g00 # interim version * 2.40.0-1 # Fedora release * 2.40.0.1 # hypothetical git release So we should use a single `+` sign for interim versions, and for the record that's what Mercurial does `6.3.3+hg591.dd42156b6441`. [1] https://rpm-software-management.github.io/rpm/manual/dependencies.html Cc: Junio C Hamano Signed-off-by: Felipe Contreras --- GIT-VERSION-GEN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 161fcdf1ab..99584bf86d 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -2,7 +2,7 @@ get_version () { test -f version && cat version && return - git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/./g' -e 's/^v//' + git describe --match "v[0-9]*" --dirty 2>/dev/null | sed -e 's/-/+/' -e 's/^v//' } NEW="GIT_VERSION = $(get_version)" -- 2.40.0+fc1