Open robmadole opened 11 years ago
Hi!
Before I found jig, I wrote git-pre-commit-hook. git-pre-commit-hook depends from git-pre-commit-hook-utils. Maybe, git-pre-commit-hook-utils can help with this problem. Additional features: works with initial commit (jig now write message that one commit required) and with "strange" filenames.
Oh nice. I have an implementation that fixes this issue sitting in the ci
branch but it's not ready for release yet. I will most certainly checkout your projects and borrow your better ideas. Thanks for sharing.
As reported by @amorriso in https://github.com/robmadole/jig-plugins/issues/3
FYI, all the pre-commit scripts only verify files on disk. These should be changed to verify files that are actually staged.
One solution was to stage changes so the files on disk were pristine and matched the index.
Stash any changes to the working tree that are not going to be committed
... execute pre-commit stuff
Unstash changes to the working tree that we had stashed
One concern I have for this is sometimes
stash
misbehaves and the Git Python library can also be temperamental. However this proof of concept is a good start.