-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: 'go get' fails to track a branch which contains a /
#38861
Comments
notice that vscode default branch naming policy is with a slash, therefore, the issue is systematic with this configuration. https://github.com/microsoft/vscode-pull-request-github/blob/main/package.json "githubIssues.issueBranchTitle": {
"type": "string",
"default": "${user}/issue${issueNumber}",
}, |
I‘ve tried quoting the branch name, but that doesn‘t help either. |
This comment was marked as duplicate.
This comment was marked as duplicate.
See #32955 |
Thank you @tonglil - this is indeed a duplicate of the older issue, which has had more discussion. My guess is that this issue got more thumbs up reactions because the title is closer to what the user's situation tends to be: git branches containing slashes. I'm going to close this as a duplicate for now. For updates, please subscribe to #32955. As a temporary workaround in case any of you are blocked, you can use |
Is it a dup? #32955 is focused on proxy behaviors. I'd swear I encountered this before the proxy |
I am pretty sure, and just ran a test:
|
Thanks for the link to the underlying issue @mvdan. For what it is worth, I never set Am I correct in understanding the workaround for this issue is to remove the Golang proxy from |
Correct. Just don't set |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was attempting to test changes in a branch of a vendored dependency on a private repository. Having never done this before using go modules, I found the docs (https://golang.org/cmd/go/#hdr-Add_dependencies_to_current_module_and_install_them) which indicated I should
go get
the associated repo and have the default versionoverridden by adding an @version suffix to the package argument, as in 'go get golang.org/x/text@v0.3.0'.
I assumed from there that I should add the branch as the checkout point. This resulted in the error below, indicating the version string was disallowed. Our company
namespaces
our github branches before doing the proper branch name. For us, slashes in the branch name are a common workflow. We occasionally also use multiple sub-namespaces for organisation.Upon further research, I found a docs issue (#30851), and an associated issue (#36902). After commenting on the final issue, I opened this one.
A workaround at this time is to
git log
the sha of the HEAD of the namespaced branch and thengo get
using that sha. EG:go get github.com/org/repo@sha
An ideal configuration would download new commits upon a subsequent
go get
, which the sha checkout would not.What did you expect to see?
go get github.com/org/repo@namespace/branch
downloading and checking out that go module at that branch sha.What did you see instead?
go get github.com/org/repo@namespace/branch: github.com/org/repo@namespace/branch: invalid version: version "branch" invalid: disallowed version string
The text was updated successfully, but these errors were encountered: