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: doesn't work with arbitrary git servers on https #2895

Closed
bradfitz opened this issue Feb 7, 2012 · 12 comments
Closed

cmd/go: doesn't work with arbitrary git servers on https #2895

bradfitz opened this issue Feb 7, 2012 · 12 comments
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Feb 7, 2012

I don't know what's broken here exactly, but I can't "go get" to work with
Camlistore's git server.

I've tried a bunch of variations.

Here is Camlistore's git server:

$ git clone https://camlistore.org/r/p/camlistore

Inside the camlistore repo, I have two top-level libraries, with the first depending on
the second:

$ cat testlib/testlib.go
// Package testlib implements nothing.
package testlib

import (
    "camlistore.org/r/p/camlistore.git/testlib2"
)

func Foo() string {
    return testlib2.FooHelper()
}


What is the right go get importpath?

I've read the docs, and Andrew on chat can't figure it out either.

$ go get camlistore.org/r/p/camlistore.git/testlib
# cd .; git clone camlistore.org/r/p/camlistore
/Users/bradfitz/hack/src/camlistore.org/r/p/camlistore.git
fatal: repository 'camlistore.org/r/p/camlistore' does not exist
camlistore.org/r/p/camlistore.git/testlib: exit status 128


Andrew thinks maybe it's not trying https vs git vs http?  But it's failing too quickly
for me, suggesting it's not trying anything.
@adg
Copy link
Contributor

adg commented Feb 7, 2012

Comment 1:

This command is just wrong:
  git clone camlistore.org/r/p/camlistore /Users/bradfitz/hack/src/camlistore.org/r/p/camlistore.git
The repository (argv[2]) should be a full URL with a protocol. Goinstall would cycle
through a list of protocols and use the first that worked. As is, the git command tries
to look for a directory on the local file system instead of hitting the remote host.

@bradfitz
Copy link
Contributor Author

bradfitz commented Feb 7, 2012

Comment 2:

That would explain why it fails so quickly.

@rsc
Copy link
Contributor

rsc commented Feb 7, 2012

Comment 3:

I did not implement the protocol scheme testing for the
various verion control systems.  Want to add it to vcs.go?

@bradfitz
Copy link
Contributor Author

bradfitz commented Feb 8, 2012

Comment 4:

I just skimmed get.go and vcs.go and added a bit of logging, but I'm not sure what it
supposed to be fixed, nor how.
I'm happy to do this with guidance, but it might be a lot faster for somebody who knows
this code.

@rsc
Copy link
Contributor

rsc commented Feb 8, 2012

Comment 5:

The fix would look like
In vcsCmd, add a scheme []string and also
a pingCmd string.  The latter is the command to
test whether a repository exists.
Add a vcsCmd ping method that calls pingCmd.
In vcsPaths, add a check function to this case:
    // General syntax for any server.
    {
        re: `^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$`,
    },
and have the check function add the scheme:// to the repo
after pinging the various schemes in order.  There was
an established order in goinstall; we should use the same.
Russ

@gopherbot
Copy link

Comment 6 by eikeon@eikeon.com:

I've done the fix described in comment 5 and am interested in contributing it. Next I'll
hit the learning curve on the contribution process unless someone has already beat me to
to fixing this issue?

@bradfitz
Copy link
Contributor Author

Comment 7:

Perfect!
The contribution instructions are here:
http://golang.org/doc/contribute.html

@gopherbot
Copy link

Comment 8 by eikeon@eikeon.com:

Great :)
I've run hg change to create: http://golang.org/cl/5651055/
I'm not sure from reading the contribution instructions if I'm to also run hg mail now?
Also I'm assuming I needed to ping this ticket manually as it doesn't look like the
"fixes issue" comment tied the review together with this issue.

@bradfitz
Copy link
Contributor Author

Comment 9:

Thanks.  And now join the mailing list, so you can be whitelisted to run "hg mail" in
the future without moderation:
https://groups.google.com/group/golang-dev/subscribe
(You can choose "No email", but you need to be a "member" to work around a bug with
Groups' moderation)

@gopherbot
Copy link

Comment 10 by eikeon@eikeon.com:

5651055 got a LGTM. I can't yet submit the change as I'm not in the CONTRIBUTORS file.
I've signed the CLA and will try again if I notice I've been added, else I'm assuming
someone else picks up the commit for me.
Is there a good place to look for another issue that could use someone working on it?

@rsc
Copy link
Contributor

rsc commented Feb 13, 2012

Comment 11:

I will submit that CL a bit later.  I'm trying to clean
some stuff up locally so I can patch it in.
If you search for Priority=Go1 you'll find the bugs
we think are important for the Go 1 release.
Thanks.
Russ

@rsc
Copy link
Contributor

rsc commented Feb 14, 2012

Comment 12:

This issue was closed by revision dcf5ca7.

Status changed to Fixed.

@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants