-
Notifications
You must be signed in to change notification settings - Fork 356
Description
- Follow-up to Show git commit if version information is missing #1517.
The mentioned PR did update the -version flag to show current git commit and Go version for unofficial versions (instead of an empty output).
In there, @ilyagr mentioned:
I was also thinking about an alternative plan: --version could just print the commit id, and there could be a separate --verbose-version option to print everything (including the official version, if present). However, I decided we don't really have to think about that too hard now. We can merge this and then see whether there's a demand for something more complicated.
I'd argue that lf should output the last official version it is based on unreleased version of the current milestone. Otherwise, version tests like mentiont in Tips are not possible.
As someone who is involved in lfs development and constantly runs different versions to test out various things, I constantly get error messages about unknown options.
The only solutions I currently have are either passing different configuration files for different executables or checking the path of the executable. Having -version still output a version on top would making this step easier.
Current behaviour, official builds:
lf -version
r38
Current behaviour, custom build:
lf -version
Built at commit: b12cb33918bb54cf8fcf2c95cf05c58c0981edff 2025-10-27T09:31:00Z
Go version: go1.25.3
Desired behaviour, custom build (open for suggestions):
lf -version
r39 (Unreleased)
Built at commit: b12cb33918bb54cf8fcf2c95cf05c58c0981edff 2025-10-27T09:31:00Z
Go version: go1.25.3
Some thoughts: I am unsure how to handle cases where someone clones the official release r38 and then modifies it.
Should it say something like:
lf -version
r38 (Modified)
Built at commit: b12cb33918bb54cf8fcf2c95cf05c58c0981edff 2025-10-27T09:31:00Z
Go version: go1.25.3
I am also unsure about the implementation details. Should the version be a (hardcoded) built-in variable that gets changes as soon as the official release has been out? Should the version number be the release one until the first new change has been merged?