Take the version from the git tag, not a constant (closes #80)
check / check (push) Waiting to run
check / check (push) Waiting to run
`mfer version`, `mfer --version` and the banner print the revision the build stamps into main.Gitrev or, when it stamped none (as after `go install` of a tag), the main module's version from runtime/debug.ReadBuildInfo. The banner no longer shows a release date. mfer.Version and mfer.ReleaseDate go, with main.Version and the version field and parameter in internal/cli that nothing read. A program using the library reads the module version from its own build information. The README says where the version comes from. Judgement call: a binary with no build information, or none holding a module version, prints "unknown", the word script/build already uses when git describe gives nothing. Model: opus-5-5
This commit was merged in pull request #204.
This commit is contained in:
@@ -17,6 +17,15 @@ The current version is pre-1.0 and while the repo was published in 2022, there
|
||||
has not yet been any versioned release. [SemVer](https://semver.org) will be
|
||||
used for releases.
|
||||
|
||||
A version is a git tag, and no file in the tree records a version number.
|
||||
`mfer version` prints the revision the build stamped into the binary, which for
|
||||
`make build` and the Docker image is the output of `git describe` on the
|
||||
checkout they build. A binary built without that stamp, as
|
||||
`go install sneak.berlin/go/mfer/cmd/mfer@<tag>` builds it, prints the module
|
||||
version Go records in it instead. A program that imports the `mfer` package
|
||||
finds the version it was built against in its own build information
|
||||
(`runtime/debug.ReadBuildInfo`).
|
||||
|
||||
This project was started by [@sneak](https://sneak.berlin) to scratch an itch in
|
||||
2022 and is currently a one-person effort, though the goal is for this to emerge
|
||||
as a de-facto standard and be incorporated into other software. A compatible
|
||||
|
||||
Reference in New Issue
Block a user