-
Notifications
You must be signed in to change notification settings - Fork 454
Should I commit _workspace? #131
Comments
Just add Godeps.json file to the repo, and _workspace to the .gitignore list :). While your code should be fully included in your repo, dependencies have to be just referenced somehow (godep.json, package.json, git submodule... you choose), and nothing more than that. Your repo - your things + references to vendor libs (of course, when it is possible, you cannot reference sourceforge zip file). |
Looks to me like the heroku buildpack expects |
I do not develop Godep, but I was taught that vendor code should not be included in the repo (we know the reasons). @kr should say what he thinks about that and make it clear is that a bug (I think it is not) or he thinks that we should deploy to heroku o some other way. Edit: it seems that http://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku.html says we should include dependencies to the repo. It seems wierd from my point of view. |
The intended use of godep is to vendor dependencies and commit the _workspace directory to version control. See the proposal document by @kr linked in #123 (proposal: http://goo.gl/RpYs8e) As discussed in that proposal, godep used to have a mode (-copy=false) that supported not vendoring the dependencies. My guess is that the ambiguous language in the Readme may be due to that. This mode has been removed as documented in #123. |
Thanks @rlmcpherson, that clears things up quite a bit. I'm still wrapping my head around go dependencies. Mind walking me through a scenario to convince me committing Say I've got a server project When I |
I understand the [docs need lots of work](tools#122 (comment)) but I think this line should be updated soon to include the decision made in tools#123, even if a big rewrite is coming. It has [confused me](tools#131 (comment)) and [several other people](http://stackoverflow.com/questions/26334220/should-i-commit-godeps-workspace-or-is-godeps-json-enough/26342342#26342342).
Please merge the referenced commit by @hurrymaplelad, this is very confusing. |
Comitting the Godep directory may not always be the right thing to do. Although I agree apps should generally do it, it is probably not the right way to go for frameworks and other external packages. |
@antonholmquist check this comment by @kr heroku/heroku-buildpack-go#65 (comment) |
Thanks for all this discussion folks. It's super helpful! 💖 |
The fact that the official way to manage dependencies is to commit the whole _workspaces directory deeply offends my sensibilities. Its really hard for me to imagine a good reason for this. It seems like the dependencies should be part of a submodule at the very least to keep the repo history clean. Also the comment/issue from heroku buildpack is gone. It would be great if the README explained the rationale for thsi practice. |
That way is called vendoring so please watch https://www.youtube.com/watch?v=c3dW80eO88I (Dave Cheney on reproducible builds) and try to think about that again. I also thought it's stupid, now I think different (keep in mind that there is no real package provider like |
Fuller question on StackOverflow.
I'm confused whether I should commit Godeps.json, _workspace, both, or it's up to me. Whatever the answer, we should update the docs to clear it up. This paragraph under Getting Started was particularly confusing:
The text was updated successfully, but these errors were encountered: