feat(cmd): print name, version, commit, and date from --version - #45
Merged
Conversation
Make `markfluence --version` emit a build stamp instead of cobra's
default "markfluence version <...>" wrapper, and unify it with the
<!-- markfluence-version --> token the converter embeds in published
pages so both print the same string.
The stamp is now "markfluence VERSION (SHA, DATE)" — a compact,
parenthesized form that adds the short vcs.revision commit hash (the
standard build identifier) alongside the commit date. The hash and date
are each omitted when the toolchain hasn't embedded VCS info, and the
parenthetical drops entirely if both are missing.
buildinfo gains Revision() and a setting() helper; the now-unused
CommitDate() is removed. root.go sets a {{.Version}} version template so
the stamp (which already carries the "markfluence" prefix) prints
verbatim.
willkg
added a commit
that referenced
this pull request
Jul 23, 2026
Reflect the new build stamp (markfluence VERSION (SHA, DATE)) that landed in #45; note it matches `markfluence --version`.
willkg
added a commit
that referenced
this pull request
Jul 23, 2026
Reflect the new build stamp (markfluence VERSION (SHA, DATE)) that landed in #45; note it matches `markfluence --version`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes
markfluence --versionprint a proper build stamp and unifies it with the<!-- markfluence-version -->token embedded in published pages — both now emit the same string.Before / after
What changed
markfluence VERSION (SHA, DATE)— a compact, parenthesized form. It adds the shortvcs.revisioncommit hash (the standard build identifier) next to the commit date, and drops the trailing unlabeled timestamp of the oldmarkfluence vVERSION COMMITDATEshape. The hash and date are each omitted when the toolchain hasn't embedded VCS info; the parenthetical drops entirely if both are missing.Stamp()is the single source for both--versionand the converter's<!-- markfluence-version -->substitution, so they can't diverge.internal/buildinfo: addsRevision()(shortvcs.revision) and asetting()helper; removes the now-unusedCommitDate(); adds tests for the date trimming and the stamp prefix.cmd/root.go: sets a{{.Version}}version template so the stamp (which already carries themarkfluenceprefix) prints verbatim rather than inside cobra'smarkfluence version <...>wrapper.The converter's token-substitution test is unaffected (it passes its own literal stamp).
make test && make lint && make vetall green.