git-xargs icon indicating copy to clipboard operation
git-xargs copied to clipboard

--version info missing when git-xargs is installed via go get

Open zackproser opened this issue 4 years ago • 2 comments

The CircleCI job for git-xargs currently sets the main go package's VERSION variable to the $CIRCLE_TAG which is either the branch name or the tag name.

This means that when we build and publish binaries through CircleCI and programmatically attach them to a new release, they correctly have their internal VERSION value set to the tag of the release and, therefore, when you run git-xargs --version against them you get back the associated tag, e.g., git-xargs version v0.0.5.

However, when you install git-xargs via go get github.com/gruntwork-io/git-xargs, the package is downloaded from Github and then built in your defined or default $GOBIN directory. In this case, the main package's VERSION value remains unset, so running git-xargs with the --version flag returns an error.

One initial idea would be to update a VERSION file in the repo each time we do a release - so that the HEAD of the default branch contains a VERSION file which always matches the latest release's tag.

zackproser avatar Apr 27 '21 00:04 zackproser

Another option is to update the version logic in go-commons to look up the latest Git ref or tag if the version param isn't set.

brikis98 avatar Apr 27 '21 07:04 brikis98

Another option is to update the version logic in go-commons to look up the latest Git ref or tag if the version param isn't set.

Ah yeah that would probably be easier to maintain going forward than having to thrash on a file in the repo itself.

zackproser avatar Apr 27 '21 19:04 zackproser

This remains an issue to my knowledge, but I won't be able to address it myself anytime soon and the issue is stale.

zackproser avatar Jul 29 '23 22:07 zackproser