Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about the pre-commit hook #90

Closed
man-shar opened this issue Sep 1, 2022 · 1 comment
Closed

Questions about the pre-commit hook #90

man-shar opened this issue Sep 1, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@man-shar
Copy link
Contributor

man-shar commented Sep 1, 2022

I've had this issue with a couple projects.

The sequence of events goes something like:

  1. I run git add .
  2. I commit. And the pre-commit hook starts.

image

  1. It seemingly runs fine and does it thing.

image

  1. But my git status is back to untracked changes in files.

image

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.)

@hobbes7878
Copy link
Member

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:
evilmartians/lefthook#64

I see a few scattered solutions, so will need to test one and then will add here.

Thanks for out-pointing @man-shar.

@hobbes7878 hobbes7878 added the enhancement New feature or request label Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants