robfig / glock

MIT License
230 stars 27 forks source link

Support dependencies that aren't working directories (or clones) #16

Closed metakeule closed 7 years ago

metakeule commented 9 years ago

Fetching a package via go get creates a repository clone or working directory (svn). It would be nice to have an option for removing the .git, .svn and the like directories below $GOPATH/src to get something like this

cd $GOPATH/src && find . -name .git -print0 | xargs -0 rm -rf

If the $GOPATH is the project repository (see #13), this would allow the dependencies inside $GOPATH/src to be checked in just like vendoring.

If glock sync could then rerun go get, then doing the sync and then remove the .gitetc folders again a very nice workflow would be possible where not just the GLOCKFILE diffs are tracked inside the repo, but also the changes inside the 3rd party packages.

Also the main repo would be self contained.

robfig commented 9 years ago

If you want to vendor the code, isn't godep the tool for that?

If glock deletes the VCS directories, then it would have to refetch them every time you sync, because there's no way to know if it's up to date. That would be incredibly slow.

metakeule commented 9 years ago

I could be an option, not the default. Maybe pre and post sync hooks could allow the user to config such an behavior.

As far as I know godep does not change / use the src tree but makes copies inside a subdir of a package.