glock icon indicating copy to clipboard operation
glock copied to clipboard

glock should detect uncommitted changes

Open robfig opened this issue 9 years ago • 4 comments

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

robfig avatar Sep 13 '14 21:09 robfig

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.

joliver avatar Sep 14 '14 16:09 joliver

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

robfig avatar Sep 14 '14 17:09 robfig

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.

dmitshur avatar Sep 14 '14 17:09 dmitshur

Very cool, thanks for the links

robfig avatar Sep 14 '14 17:09 robfig