tools / godep

dependency tool for go
http://godoc.org/github.com/tools/godep
BSD 3-Clause "New" or "Revised" License
5.54k stars 455 forks source link

Godep doesn't remove staged and unstaged code in dependencies #472

Closed trungng92 closed 8 years ago

trungng92 commented 8 years ago

I'm not sure if this is a bug/feature, and it's not a big deal. godep restore only does a git checkout {{commit}}, but if you make code changes to the repo of the dependency, it doesn't clear out these changes (which can be good and bad).

I know you shouldn't really make any changes to the code in the dependencies. I was only adding in print statements to help debug, and now that I no longer need the print statements, it would be nice if godep had a way to undo these print statements (and any other changes I made).

There could be an option like godep restore --clean or godep restore clean that does a

git reset --hard
git clean -f -d

in addition to the git checkout {{commit}}.

freeformz commented 8 years ago

You can (and arguably should) do those change in a branch and commit them. git checkout {{commit}} would then work. Why not modify your vendored copy?

trungng92 commented 8 years ago

Wow that's a good idea. I don't know why I didn't think of that. Thanks!