Skip to content

cmd/go: don't refuse to update a present package only because of its source configuration #25432

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

Closed
dsymonds opened this issue May 16, 2018 · 2 comments

Comments

@dsymonds
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +c3d10e64b9 Wed May 16 21:15:03 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

yes.

What did you do?

I have a Go package whose source is a Git repository. The correct upstream for this repository uses a non-standard network protocol (let's call it xyz://), and that is what git config remote.origin.url reports. Git itself works fine with this.

I would like to run go get -u ./... in this repository in order to refresh it and all its dependencies, just like any other Go package.

What did you expect to see?

The repo and its dependencies should be updated, even though cmd/go doesn't understand the xyz:// protocoll

What did you see instead?

package <foo>: unable to parse output of git config remote.origin.url

The simple solution is for cmd/go to not refuse to even attempt to update an existing package if it can't understand its repo configuration. I have a sample fix that does this: https://go-review.googlesource.com/c/go/+/113456

I don't expect go get to be able to fetch a package with a non-standard Git remote URL (and a fresh fetch doesn't come up too often), though that's an obvious extension.

/cc @robpike

@dsymonds dsymonds added the GoCommand cmd/go label May 16, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/113456 mentions this issue: cmd/go: don't refuse to update a present package only because of its source configuration

@ianlancetaylor ianlancetaylor added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label May 31, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.11 milestone May 31, 2018
@dsymonds dsymonds self-assigned this Jun 7, 2018
bradfitz pushed a commit that referenced this issue Jun 7, 2018
…source configuration

If a package is checked out in the right place, but uses, for instance,
an unusual Git remote configuration, don't refuse to update just because
cmd/go can't parse it. In most cases, `git pull -ff-only` (or the
equivalent in other VCSes) works just fine.

Updates #25432.

Change-Id: I1952a0e6e03f185f34029b186e1756c9549689e1
Reviewed-on: https://go-review.googlesource.com/113456
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
@dsymonds dsymonds removed the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jun 7, 2018
@dsymonds
Copy link
Contributor Author

dsymonds commented Jun 7, 2018

An argument could still be made to permit unknown protocols to still be fetchable, but it's nowhere near as pressing as what 17f5423 fixed (updating in place), so I'm going to mark this as done.

@dsymonds dsymonds closed this as completed Jun 7, 2018
@golang golang locked and limited conversation to collaborators Jun 7, 2019
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

3 participants