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: remote import path meta tag format should accept multiple paths #9532
Comments
Also, forgot to mention that we used Git's |
Doesn't seem worth the complexity. I don't know that git think you mentioned, but you could also just write a program to scan your $GOPATH and convert any origins from their public to auth-required URLs. At least that program would stay out of cmd/go. |
It's not just a one-shot problem. It's an ongoing thing. Once you've got this kind of package in your It's not a lot of complexity. The implementation would be a trivial bit more parsing ( |
The git url.pushInsteadOf configuration is to solve this kind of problems. |
@minux: Please read what I wrote on #9532 (comment). That's an incomplete solution. |
Why it's incomplete? Only the author of the package need to set up |
Everyone who wants push access to a repo needs to do it, and it needs to be done on every machine that has a checkout. That's M*N instead of 1 (a single change in the meta tag). In the simplest case, yes, it'll be a fine workaround when M=N=1, but it's kinda clunky to do that to work around a deficiency in the |
David, even with your proposal, each author needs to independently configure the git origin from http to ssh once, no? I guess you're fine with that, but just want the tool to stop complaining thereafter? But if you're already fine with the user having to configure the repo to commit elsewhere, maybe instead we add a mechanism to shut up the warning... some sort of "yes-i-know-you-don't-like-this-location-but-it's-cool-trust-me" flag. Then if the upstream URL for authors is secret (e.g. some internal corp URL), you don't have to leak it publicly too. |
That would be fine with me too. |
I'm concerned that relaxing the check will make vanity import The author of a package always need to do something special for I just checked that the author can simply set and then he can push without problem, and go get -u won't bark, |
On 9 January 2015 at 11:32, Minux Ma notifications@github.com wrote:
That did not work for @robpike yesterday, which is what started all this. |
It exists. "go get -u -f" |
I just created a clone of the filter repo, and tried this: And git push worked for me. |
Oh, I missed you were setting .pushurl instead of .url. Yeah, that's an equivalent workaround to the pushInsteadOf config, except that now you need to do it for each repo instead of potentially just once in your $HOME/.gitconfig. |
Right, but as I said earlier, the author always need some This is similar to #9300 and all the other issues requesting Unless go get supports cloning form the ssh URLs, I don't |
Not worth the complexity. |
The meta tag has this format: (from http://golang.org/cmd/go/#hdr-Remote_import_paths)
Unfortunately, this doesn't permit multiple equivalent roots, where the repo is the same but has multiple access methods. For instance, https://github.com/robpike/filter is canonically
robpike.io/filter
, and is accessible via at least two methods:https://github.com/robpike/filter.git
(no auth required to fetch)git@github.com:robpike/filter.git
(will use your SSH keys for push auth)However, his meta tag has to look like
so that Joe Random can run
go get robpike.io/filter
.It would be ideal if, say, @robpike could interact wholly with the repo via
git@github.com:robpike/filter.git
(since his SSH keys will be used when pushing), but he can still usego get -u robpike.io/filter
too.One obvious fix is to expand the meta tag format to have multiple repo roots. The first is semantically the default, but all are considered equivalent and permitted by the
go
tool's vanity URL enforcement mechanism. Then @robpike can have a meta tag likeThe text was updated successfully, but these errors were encountered: