From 78c406d67e90c2a9fdcbc7c760c1a3e28b6b59b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Thu, 22 May 2025 12:20:24 +0200 Subject: [PATCH] loop: add `commit_hash` to --version output The `commit_hash` field will contain the full commit hash of the commit that build was based on. --- version.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/version.go b/version.go index 82832bcc..e6fe9c39 100644 --- a/version.go +++ b/version.go @@ -64,10 +64,14 @@ func Version() string { // RichVersion returns the application version as a properly formed string // per the semantic versioning 2.0.0 spec (http://semver.org/), followed by the -// most recent git tag the build was built on. +// most recent git tag and commit hash the build was built on. func RichVersion() string { - // Append the most recent git tag of the current build to version. - return fmt.Sprintf("%s commit=%s", semanticVersion(), Commit) + // Append the most recent git tag and commit hash of the current build + // to version. + return fmt.Sprintf( + "%s commit=%s commit_hash=%s", semanticVersion(), Commit, + CommitHash, + ) } // UserAgent returns the full user agent string that identifies the software