Stash changes not in index before applying hooks #99
Labels
bug
Something isn't working
enhancement
New feature or request
help wanted
Extra attention is needed
Hi, and thanks for developing this great tool!
Unexpected behavior:
When applying the hooks with Mookme, the hooks are run with the working tree as-is, as far as I understand. This may cause confusing behavior for files that are only partially stashed. For example, a linter may pass even when the stashed file is not acceptable.
What do you suggest:
pre-commit solves this by stashing away the working tree not in index before the hooks are run. It is obviously possible to write this manually in the hook files, but I believe it would be great if this could be added directly into Mookme.
Concrete example
I have a
black
formatter hook. When attempting to commit, black is run on the file, but the commit is not committed, as Mookme is set to exit on error. Now, parts of the file is staged, in an unacceptable state, and the parts that have been changed by black, are not staged. When attempting to commit anew, without first staging the new changes, the commit is accepted, as black is run against the working tree.The text was updated successfully, but these errors were encountered: