-
Notifications
You must be signed in to change notification settings - Fork 934
fix: commitlint is reading previous commit message #3780
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
Comments
Does this work for you?: #!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx commitlint --edit |
This comment was marked as duplicate.
This comment was marked as duplicate.
1 similar comment
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Found the solution! You need to rename your hook from pre-commit to commit-msg. From the git hooks docs:
|
@SyedTayyabUlMazhar thanks for you comment! @chandrashekhar07 how did you come up with using |
@escapedcat I found the solution by reading git's documentation on hooks. |
Thanks!
Anyone up for a PR to improve the docs? |
Docs were improved, please see if this helps |
Expected Behavior
commitlint should evaluate the current/last commit message
Current Behavior
commitlint is reading the previous commit message while evaluating the result
My commit message is:
testing
But
npx --no -- commitlint --edit ${1} --verbose
is evaluating the result of the previous commit.the
Affected packages
Possible Solution
No response
Steps to Reproduce
At first, I added a valid commit message, but in the middle of committing process (husky evaluation), I canceled the process using
ctrl + c
Then I changed my message to something else but still commit lint is evaluating the result of the previous commit.
The text was updated successfully, but these errors were encountered: