From f0365087cef20a00c9079160996f648b201022b0 Mon Sep 17 00:00:00 2001 From: Grzegorz Dlugoszewski Date: Sat, 23 Aug 2025 22:36:03 +0200 Subject: [PATCH] Remove the awkward "built at" section from --version --- pkg/cfg/config.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/cfg/config.go b/pkg/cfg/config.go index 09f3cdb..a8f6be1 100644 --- a/pkg/cfg/config.go +++ b/pkg/cfg/config.go @@ -49,17 +49,20 @@ var AllowedOut = []string{OutDump, OutFlat, OutTree} var ( version string commit string - date string ) -// Version returns a string with version metadata: version number, git sha and build date. -// It returns "development" if version variables are not set during the build. +// Version returns a string with version metadata: version number and git commit. +// It returns "git-get development" if version variables are not set during the build. func Version() string { if version == "" { - return "development" + return "git-get development" } - return fmt.Sprintf("%s - revision %s built at %s", version, commit[:6], date) + if commit != "" { + return fmt.Sprintf("git-get %s (%s)", version, commit[:7]) + } + + return fmt.Sprintf("git-get %s", version) } // Gitconfig represents gitconfig file