git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] GIT-VERSION-GEN: Use standard versioning suffix

From
JRJonas Rebmann <jre@pengutronix.de>
Date
Sep 5, 2025, 12:14 UTC
Message-ID
<20250905-semver-v1-1-3f6dd32f71a3@pengutronix.de>

In snapshot builds of git, git-version uses a modified variant of the git-describe output, e.g. 2.51.0.178.g2462961280 instead of 2.51.0-178-g2462961280 for seemingly historical reasons.

This is not semver compliant which makes the output harder to parse in tooling such as b4, which currently errors out when using a snapshot build of git.

For snapshot builds, use as version string the unmodified git-describe output with only the leading v stripped from the tag.

Fixes: 5c7d3c9507f7 ("Allow building of RPM from interim snapshot.")
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
 GIT-VERSION-GEN | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index b16db85e77..99e04588f3 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -52,7 +52,7 @@ then
 		*$LF*) (exit 1) ;;
 		esac
 	then
-		VN=$(echo "$VN" | sed -e 's/-/./g');
+		: # use VN as set by git describe
 	else
 		VN="$DEF_VER"
 	fi

---
base-commit: 2462961280690837670d997bde64bd4ebf8ae66d
change-id: 20250905-semver-2e9a9a9c77ef

Best regards,
--  
Jonas Rebmann <jre@pengutronix.de>
Next: brian m. carlson
Message 1 of 5 in “GIT-VERSION-GEN: Use standard versioning suffix”
  1. GIT-VERSION-GEN: Use standard versioning suffixJonas Rebmann, Sep 5, 2025
  2. brian m. carlsonSep 5, 2025
  3. Jonas RebmannSep 5, 2025
  4. Junio C HamanoSep 5, 2025
  5. Kristoffer HaugsbakkSep 5, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.