Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

record alternative source repo location #366

Open
freeformz opened this issue Dec 16, 2015 · 4 comments
Open

record alternative source repo location #366

freeformz opened this issue Dec 16, 2015 · 4 comments

Comments

@freeformz
Copy link

There are times where a long lived fork / pr of a dependency is needed. We should record the alternative location or provide a means to do so.

@ironcladlou
Copy link

Would it make any sense to add a dependency field like ForkedFrom which is a VCS URI? With that field, it would be possible to introduce a step internally between download and restore that could use the VCS abstraction to add and fetch a Git remote (for example). Then the dependency's Rev could refer to a commit carried only in the fork.

@eparis
Copy link

eparis commented Dec 16, 2015

I've had some small flashes of thought about this kind of thing and wasn't ever quite sure what to do about packages in the repo. Lets say we have a VCS field which says github.com/docker/docker.git sha12345. But my package is github.com/docker/docker/pkg/timeutils. It is relatively easy to figure that out and know how to stitch those together on the filesystem so things work.

But what about when my VCS is parisplace.org/bob.git and the package I care about is k8s.io/kubernetes/pkg/util/sets. How do you know if my checkout of parisplace.org/bob.git belongs in k8s.io/ k8s.io/kubernetes/ k8s.io/kubernetes/pkg/ k8s.io/kubernetes/pkg/util/

I've never quite figured out in my mind (and I haven't thought about it a lot) how to link a VCS+Rev information to a 'package'

@ironcladlou
Copy link

It seems like all that's necessary is to add a step here to fetch a defined fork repo (a concept which I believe exists in all three supported VCS implementations). That would make the rev available from both the repo retrieved via go get and from the user defined fork location. We already know the root package location (and thus VCS root) for a given import path.

The problem I'm seeing is that the golang/x/tools/go/vcs package provides no lowest-common-denominator API for the fetch. Once you create the repo, you're stuck with just commits from the repo downloaded via go get repo unless you hack outside the vcs package.

@freeformz
Copy link
Author

I was wondering if, across all vcs, if it's possible to determine which remote has a given ref. godep save could record the appropriate remote if so in a key.

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