Closed man-shar closed 2 years ago
Weird... You're right!
After I moved us from husky to lefthook for git hooks, apparently the behaviour is different. Lefthook doesn't automatically add changed files to the last commit: https://github.com/evilmartians/lefthook/issues/64
I see a few scattered solutions, so will need to test one and then will add here.
Thanks for out-pointing @man-shar.
I've had this issue with a couple projects.
The sequence of events goes something like:
I run
git add .
I commit. And the pre-commit hook starts.
It seemingly runs fine and does it thing.
But my git status is back to untracked changes in files.
I usually "solve" this by continue to git-add and commit till my git is all clean post the pre-commit hook.
I guess my primary question is if this is intentional behaviour?
If so, could multiple people working on the same project face merge issues because there's untracked changes after the hook I might be unaware of? (I wouldn't have bothered with a git status after committing if I didn't have the zsh indicator.)