Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing version info #1587

Closed
somera opened this issue Nov 19, 2021 · 8 comments
Closed

Missing version info #1587

somera opened this issue Nov 19, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@somera
Copy link

somera commented Nov 19, 2021

Is your feature request related to a problem? Please describe.
Why lazygit -v is not showing any info?

$ lazygit -v
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64

Same in the UI

image

@somera somera added the enhancement New feature or request label Nov 19, 2021
@jesseduffield
Copy link
Owner

This would be because the binary was built from source as opposed to being built with version flags. May I ask where you got the binary from?

@somera
Copy link
Author

somera commented Nov 22, 2021

Self compiled ... https://github.com/jesseduffield/lazygit#manual

git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install

At the momement I can't see which version I'm running.

@jesseduffield
Copy link
Owner

Go 1.18 will allow adding the git commit sha in the installed binary without adding any additional flags, but that go version is a little way off at the moment (should be out in february I believe) https://utcc.utoronto.ca/~cks/space/blog/programming/GoVersionOfYourSource

@somera
Copy link
Author

somera commented Nov 22, 2021

But we are talking about the lazygit version. And not the git version.

@jesseduffield
Copy link
Owner

jesseduffield commented Nov 22, 2021

the lazygit version e.g. v0.31.3 is based on a git tag with that version being baked in upon build, which itself is just against a particular commit sha. We add this on release with the following ldflags (from .goreleaser.yml, see https://goreleaser.com/customization/build/):

    ldflags:
      - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.buildSource=binaryRelease

I'm not sure how we would add this version info upon local install other than having a bash/Go script which gets the head commit and the name of a tag against that commit, if one exists, and then builds the binary with similar ldflags to the above. I'm happy to accept a PR which adds such a script

@somera
Copy link
Author

somera commented Nov 22, 2021

I'm happy to accept a PR which adds such a script

Sounds good.

@jbrains
Copy link
Contributor

jbrains commented Jan 18, 2022

Does this issue duplicate #1439 ?

@jesseduffield
Copy link
Owner

Good point. I'll close this off in favour of #1439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants