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: feature request: go get with HG over ssh #6026

Closed
robfig opened this issue Aug 3, 2013 · 3 comments
Closed

cmd/go: feature request: go get with HG over ssh #6026

robfig opened this issue Aug 3, 2013 · 3 comments

Comments

@robfig
Copy link
Contributor

robfig commented Aug 3, 2013

What steps will reproduce the problem?
1. Set up Mercurial to serve a repo over ssh 
2. Attempt to use "go get" to access the repo, specifying the repo using an
absolute path

What is the expected output?
I would expect it to be possible

===

I would like to be able to fetch private repositories with "go get", via ssh. 
However, HG over ssh uses a double slash to specify an absolute path, and "go
get" cleans the URL of double slashes, converting them to single slashes. 

Example

A mercurial command to clone the repo would be: 
$ hg clone ssh://myhg.com//abs/path/to/repo"

Attempting it with "go get":
$ go get -x -v myhg.com//abs/path/to/repo.hg

Results in:
...
# cd .; hg identify ssh://myhg.com/abs/path/to/repo
remote: abort: There is no Mercurial repository here (.hg not found)!
abort: no suitable response from remote hg!
myhg.com/abs/path/to/repo.hg (download)

HG uses a double slash to denote an absolute path.  With a single slash, the path is
taken relative to the user's home directory (which is not appropriate for shared repos). 

===

Kyle Lemons had some notes:
- to handle this case, only // between the host and path would need to be maintained
- we might also only allow the // when we try ssh://, since that seems like the only one
that wants it
@dsymonds
Copy link
Contributor

dsymonds commented Aug 5, 2013

Comment 1:

I'm not sure there's a change to be made here. The argument to go get is an import path.
The common case where the import path matches a well-known repo (e.g. github) is handled
to make things smoother, but it still remains that the argument is an import path, not a
URL.
I agree it would be neat if it "just worked", but it's not hard to
  cd $GOPATH/src
  hg clone ssh://myhg.com//abs/path/to/repo

Labels changed: added priority-someday, toolchange, removed priority-triage, go1.2maybe.

@robpike
Copy link
Contributor

robpike commented Aug 14, 2013

Comment 3:

Status changed to WontFix.

@gopherbot
Copy link

Comment 4 by K2xL.com:

It would be nice to be able to go get ssh:// and the go get tool would auto strip out
the ssh and port numbers when creating the directories in GOPATH.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
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