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 in go1.5 doesn't understand some git remote URLs #12313

Open
akalin opened this Issue Aug 25, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@akalin

akalin commented Aug 25, 2015

I get this on my repo:

go get -u ./...
package ...: unable to parse output of git config remote.origin.url

the output of git config remote.origin.url looks like:

github-something:path/to/project.git

where github-something is defined in my ssh-config like so:

Host github-something
 User git
 HostName github.com
 PasswordAuthentication no
 IdentityFile /path/to/home/.ssh/id_rsa.something

(I do this to manage multiple github identities with different certs.)

This worked fine in go 1.4.2.

@akalin

This comment has been minimized.

akalin commented Aug 25, 2015

A workaround is to change the remote URL to:

git@github-something:path/to/project.git

It would be nice if this weren't needed though, since it repeats the username.

@mikioh mikioh changed the title from go get (1.5): go get doesn't understand some git remote URLs to cmd/go: go get in go1.5 doesn't understand some git remote URLs Aug 29, 2015

@rsc

This comment has been minimized.

Contributor

rsc commented Oct 23, 2015

This happens in src/cmd/go/vcs.go's gitRemoteRepo. @adg added the code to turn git's shorthand user@server:path into a proper URL ssh://user@server/path. It seems okay to me to make the same code turn server:path into ssh://server/path.

@rsc rsc added this to the Go1.6 milestone Oct 23, 2015

@gopherbot

This comment has been minimized.

gopherbot commented Dec 17, 2015

CL https://golang.org/cl/17951 mentions this issue.

@rsc rsc closed this in 3e9f063 Dec 17, 2015

rsc added a commit that referenced this issue Dec 17, 2015

Revert "cmd/go: allow omitted user name in git ssh repo syntax"
This caused #13657.
Reverting fixes #13657.

I was trying to be helpful by fixing #12313,
but I don't need the fix myself.
Will leave for someone with more motivation.

This reverts commit 3e9f063.

Change-Id: Ifc78a6196f23e0f58e3b9ad7340e207a2d5de0a6
Reviewed-on: https://go-review.googlesource.com/17977
Reviewed-by: Russ Cox <rsc@golang.org>
@rsc

This comment has been minimized.

Contributor

rsc commented Dec 17, 2015

My fix caused #13657.
Leaving for someone who needs the fix more.

@rsc rsc reopened this Dec 17, 2015

@rsc rsc modified the milestones: Unplanned, Go1.6 Dec 17, 2015

@dmitshur

This comment has been minimized.

Member

dmitshur commented May 26, 2016

A workaround is to change the remote URL to:

git@github-something:path/to/project.git

It would be nice if this weren't needed though, since it repeats the username.

Another workaround is to use an easier-to-parse URL format that url.Parse supports instead of the SCP-like syntax:

ssh://github-something/path/to/project.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment