From b6b0b754d99dc2298930cb5db42950bf7c08cc08 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 15 Feb 2026 18:54:42 +0100 Subject: build: Automatically parse version from tag The build will now parse tags so the git tag is now the single source of truth for a version. We do not need to manually maintain the version header. The VERSION file uses git's export-subst feature. When git archive creates a snapshot (e.g. cgit), git substitutes the $Format:...$ placeholder with the output of git describe, embedding the version string directly in the archive. This requires the export-subst attribute to be set for the VERSION file in the repository's .gitattributes. The version is resolved in the following order: - git describe (inside a git repository with tags) - the VERSION file (archives/snapshots) - 0.0.0 (fallback) The build system will warn when it can't set a correct version, such as in a git repo without tags, or an archive without VERSION. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- VERSION | 1 + 1 file changed, 1 insertion(+) create mode 100644 VERSION (limited to 'VERSION') diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..4c3f2e25 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +$Format:%(describe:tags=true,match=[0-9]*.[0-9]*.[0-9]*)$ -- cgit v1.2.3