Skip to content

proposal: Support checking out a commit with go get #13483

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
sparrc opened this issue Dec 4, 2015 · 2 comments
Closed

proposal: Support checking out a commit with go get #13483

sparrc opened this issue Dec 4, 2015 · 2 comments

Comments

@sparrc
Copy link

sparrc commented Dec 4, 2015

I've seen many projects being worked on to support vendoring in go projects, as well as the official go "vendor" directory experiment.

All of these solutions require that the project using them keep a copy of all dependencies within their repository, and all of them seem rather complicated.

I feel that this could be a lot more simple if the go get tool supported checking out specific changesets. That way you could simply have a "manifest" file (similar to Godeps.json) in your repo like this:

github.com/dependency/one 1a1a1a1a1a1a1a1a1a1a
github.com/dependency/two 2b2b2b2b2b2b2b2b2b2b
github.com/dependency/three v0.2.1

Then all a management tool would need to do is run:

go get github.com/dependency/one 1a1a1a1a1a1a1a1a1a1a
go get github.com/dependency/two 2b2b2b2b2b2b2b2b2b2b
go get github.com/dependency/three v0.2.1

And then the builder will have the dependencies checked out in their regular GOPATH, no need to vendor all of the source code within their repository.

Once the correct changesets are checked out, the builder does not have to worry about using any outside tools to build their project, just the standard go tools.

This was inspired by how Android projects manage their dependencies: http://developer.android.com/guide/topics/manifest/manifest-intro.html. In android projects, repositories contain no dependencies other than the manifest.xml file, which simply identifies the repos and changesets to check out.

To me, this seems like a natural thing for go get to do, since currently the two options are either: (1) checkout HEAD/tip (go get -u), or (2) checkout without paying attention to the revision (go get).

@sparrc sparrc changed the title Support checking out specific commit hash/revision/changeset with go get proposal: Support checking out specific commit hash/revision/changeset with go get Dec 4, 2015
@sparrc sparrc changed the title proposal: Support checking out specific commit hash/revision/changeset with go get proposal: Support checking out a changeset with go get Dec 4, 2015
@sparrc sparrc changed the title proposal: Support checking out a changeset with go get proposal: Support checking out a commit with go get Dec 4, 2015
@kardianos
Copy link
Contributor

@sparrc
I just saw this. What do you think of #13517 ?

@adg
Copy link
Contributor

adg commented Aug 15, 2016

This is part of the greater dependency management story, and I think any change will be much bigger in scope than this specific proposal. In that light, I am declining this proposal. If you disagree with my decision please let me know. Thanks for your time.

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

5 participants