chriswalz / bit

Bit is a modern Git CLI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homebrew installation shows 0.9.10, `bit --version` shows 0.8.0

macintacos opened this issue · comments

Describe the bug
I reinstalled the bit-git homebrew formula twice now, and am still getting the same results:

$ brew reinstall bit-git
==> Downloading https://homebrew.bintray.com/bottles/bit-git-0.9.10.catalina.bottle.tar.gz
Already downloaded: /Users/juliant/Library/Caches/Homebrew/downloads/f3b3548a66e7a547445566b4ebd93c283a5d35ef7bd6cfdeca1dd87ddcb3a2c5--bit-git-0.9.10.catalina.bottle.tar.gz
==> Reinstalling bit-git
==> Pouring bit-git-0.9.10.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/bit-git/0.9.10: 6 files, 13.3MB
$ bit --version
bit version v0.8.0
git version 2.29.2

I do see that there's a comment in main.go saying that "v0.8.0" should be overwritten at compile time - is this just an issue with the homebrew installation then? I just want to make sure I have the most recent version.

Expected behavior
bit --version would output the correct, current version (0.9.10 at time of writing).

Desktop (please complete the following information):

  • OS: macOS 10.15.7
  • Terminal: iTerm 2
  • Shell: zsh

@macintacos hmm I believe you're right.

in https://github.com/Homebrew/homebrew-core/blob/master/Formula/bit-git.rb

system "go", "build", *std_go_args

should be something like

system "go", "build", *std_go_args -ldflags "-X main.version=0.9.10"

Example in terminal

go build -ldflags "-X main.version=EXAMPLE.VERSION" main.go
./main --version
bit version EXAMPLE.VERSION
git version 2.24.3 (Apple Git-128)

@crunchtime-ali do you know? 🙏 I'm a ruby noob

@crunchtime-ali do you know? 🙏 I'm a ruby noob

I will have a look at it tomorrow. I am also quite inexperienced with Ruby. I would prefer rewriting Homebrew in Golang or Rust but psst... don't tell anyone :)

For the time being, just to clarify - I am running the latest, correct? It's just an issue with how the version number is calculated when pushing a new version to Homebrew or what have you?

@crunchtime-ali did you around to looking at this. I'm pretty confident it's a one line fix similar to this go build -ldflags "-X main.version=EXAMPLE.VERSION" main.go

@crunchtime-ali did you around to looking at this. I'm pretty confident it's a one line fix similar to this go build -ldflags "-X main.version=EXAMPLE.VERSION" main.go

Sorry, I didn't. I am a little swamped by working currently. Specifying the version manually will likely be the fix. I will get around to do it no later than Saturday and will also take a look at the other issues regarding the brew formula.

@chriswalz @macintacos Sorry, it took a bit longer than expected.
I just submitted a PR here Homebrew/homebrew-core#64390

Great, thank you!