Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upcmd/go/internal/get: VCS path regexp omits characters accepted by CheckImportPath #31376
Comments
This comment has been minimized.
This comment has been minimized.
Duplicate of #26134 |
This comment has been minimized.
This comment has been minimized.
The regular expression that looks for the go/src/cmd/go/internal/get/vcs.go Line 1028 in ccd9d9d Testing against that (playground) reveals that the problem here is that the go/src/cmd/go/internal/get/path.go Lines 125 to 136 in 3cb92fc |
This comment has been minimized.
This comment has been minimized.
This needs a fix, but it's not obvious to me whether the VCS path should be made more permissive, or |
This comment has been minimized.
This comment has been minimized.
I'm confused by whether the |
This comment has been minimized.
This comment has been minimized.
When Launchpad code hosting added git support it was necessary to add +git as a path component to avoid namespace clashes with Bazaar branches. Launchpad code hosting is pretty much stuck with it, but yes, + will be very uncommon, unlike other special characters such as ~. The trailing .git is optional, and only in my example because I wanted to skip the https: VCS detection (probably necessary for private repositories, when I get that far). |
This comment has been minimized.
This comment has been minimized.
I checked the new module index for other existing packages that use the (That's not to say that they don't exist, but if they do they're rare.) Perhaps we should disallow |
This comment has been minimized.
This comment has been minimized.
If this is not a breakage introduced after Go 1.12, I'm inclined to leave deciding what to do until after Go 1.13 is out. |
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?
Attempted to fetch the git repo containing a go package, publicly available at:
Per
go help importpath
, the following should attempt a git download using https://, falling back to git+ssh://Attempting to force ssh per
git help environment
does not helpWhat did you expect to see?
go get
attempt to clone the git repo at https://git.launchpad.net/~stub/+git/go-eggs, and if that failed, fall back to cloning the git repo at git+ssh://git.launchpad.net/~stub/+git/go-eggs.Per
go help importpath
, because the import path has a version control qualifier (.git
) then no attempt should be made to attempt to get the import over https: to look for a tag.What did you see instead?
Go get attempts to parse meta tags from https://, which fails. No attempt is made to clone the git repo.