robfig / glock

MIT License
230 stars 27 forks source link

glock should detect uncommitted changes #9

Open robfig opened 10 years ago

robfig commented 10 years ago

Presently glock only reads the currently checked-out commit, and it reports [OK] if there are uncommitted changes. Instead, it should report uncommitted changes as an error that the user should resolve

joliver commented 10 years ago

Does this capability also apply to all dependencies? If a dependency isn't in a clean state then it's even worse than the main repo because it's out of sight and harder to detect.

robfig commented 10 years ago

Yeah, I meant dependencies, not the main repo. (Frequently the main repo is dirty with in-progress changes)

dmitshur commented 10 years ago

It makes sense for glock to do that. It would be inaccurate to save a dependency as a given revision when it has a dirty working tree - resulting in a non-reproducible build for others being potentially pushed.

It's basically the equivalent of using gostatus in the following way:

# Legend:
#  b - Non-master branch checked out
#  * - Uncommited changes in working dir

# Show status of all dependencies (recursive) of package in cur working dir.
go list -f '{{join .Deps "\n"}}' . | gostatus --all

And making sure none of the dependencies have b (non-master branch checked out) or * (dirty working tree) status.

gostatus uses this vcs package to figure that out.

Also, FWIW, godep already had this functionality - it wouldn't let you do godep save --copy=false if one of the dependencies had a dirty working tree.

robfig commented 10 years ago

Very cool, thanks for the links