livebud / bud

The Full-Stack Web Framework for Go
MIT License
5.53k stars 181 forks source link

feature idea: detect git short version hash during build and embed into binary #340

Open syke99 opened 1 year ago

syke99 commented 1 year ago

This PR addresses the first proposed solution to this issue. The second proposed solution is not implemented in this PR, but can be added with further information provided.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

matthewmueller commented 1 year ago

Hey @syke99 thanks for working on this!

I'm a bit confused by the PR though. It's not really connected to Bud in anyway. You'd need to add the -ldflags to the app command. Is this still a draft PR?

I'm also thinking we can simplify this buildinfo package quite a bit, pretty sure something like: https://github.com/livebud/bud/blob/d243eedcb7e71b0c323c4771397c051a7872bf6c/internal/versions/versions.go#L4 would suffice.

syke99 commented 1 year ago

Hey @matthewmueller, I'm so sorry. Yes, this was supposed to just be a draft PR for now. I was expecting to continue being able to work on it, but I've had some personal stuff come up that has been taking precedence, so I've had to step away. And you're right, that does seem like it would suffice for what I had added. Again, my apologies!!