‘git commit —amend’ triggers precommit hook
Running ‘git commit —amend’ to edit commit message triggers the husky precommit that I have set up in my package.json.
That’s still a commit
Thanks @alexeyten . After having a look at the official docs I believe you are right. It clearly states that this will 'Replace the tip of the current branch by creating a new commit.' - https://git-scm.com/docs/git-commit#git-commit---amend
I shall close this issue.
It shouldn't be a commit until the message is actually amended. pre-commit is running before a developer gets a chance to edit the commit message, and if there are any validations running on the message, it'll continuously fail without the opportunity to update. I think this is an issue.