From 4edaed429787bb7e6a681498f12f4b8bf20024ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Tigerstr=C3=B6m?= Date: Tue, 13 May 2025 12:10:32 +0200 Subject: [PATCH] terminal: 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/version.go b/version.go index e7f7a700..082a1fc1 100644 --- a/version.go +++ b/version.go @@ -48,12 +48,13 @@ func Version() string { } // RichVersion returns the application version as a properly formed string -// per the semantic versioning 2.0.0 spec (http://semver.org/), the git tag it -// was built on. +// per the semantic versioning 2.0.0 spec (http://semver.org/), the git tag and +// commit hash it was built on. func RichVersion() string { - // Append git tag of current build to version. + // Append git tag and commit hash of current build to version. return fmt.Sprintf( - "%s commit=%s", semanticVersion(), Commit, + "%s commit=%s commit_hash=%s", semanticVersion(), Commit, + CommitHash, ) }