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

cmd/go/internal/vcs: ignores selected branch when getting most recent commit #61045

Closed
nreilly opened this issue Jun 28, 2023 · 3 comments
Closed
Labels
FrozenDueToAge GoCommand cmd/go WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@nreilly
Copy link

nreilly commented Jun 28, 2023

The current go source for getting the most recent commit hash doesn't appear to consider the currently active branch.

What version of Go are you using (go version)?

go version go1.20.5 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="darwin"

What did you do?

Compiled code from a branch, the code uses debug.ReadBuildInfo() to get information about the branch/commit being used for the build. This hash was not the most recent in the branch being used, it was the most recent commit in the repository.

What did you expect to see?

The most recent commit in the currently used branch

What did you see instead?

The most recent commit in the repository

@seankhliao
Copy link
Member

can you please include a test program and instructions to reproduce the issue

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 28, 2023
@bcmills bcmills added the GoCommand cmd/go label Jun 28, 2023
@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2023

The Go command does not have a notion of the “active branch” for a module repository.

Perhaps this is a duplicate of #26964?

@bcmills bcmills changed the title src/cmd/go/internal/vcs/vcs.go: ignores selected branch when getting most recent commit cmd/go/internal/vcs/vcs.go: ignores selected branch when getting most recent commit Jun 28, 2023
@bcmills bcmills changed the title cmd/go/internal/vcs/vcs.go: ignores selected branch when getting most recent commit cmd/go/internal/vcs: ignores selected branch when getting most recent commit Jun 28, 2023
@bcmills bcmills added this to the Backlog milestone Jun 28, 2023
@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2023

Or are you talking about go get in GOPATH mode in particular? If so, please see #60915, which proposes to maintain support for go build but not go get in that mode.

@nreilly nreilly closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2023
@golang golang locked and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants