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.
This commit is contained in:
Viktor Tigerström 2025-05-22 12:20:24 +02:00
parent cdcacfe753
commit 78c406d67e
No known key found for this signature in database
GPG key ID: B984570980684DCC

View file

@ -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