-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Option to allow fixup!
and squash!
in commit messages
#414
Comments
I'm good with this feature @woile What do you think? |
I'm fine with it, just wondering how to include this. We also have the signed commits with
What do you think would be the best interface? |
I'm ok with |
I don't think this is related to git itself. It's just a matter of allowing fixup commits in the regexp. For example, having the commit-msg pre-commit hook installed, there should be a way to let this not fail: > git commit -a --fixup 57a2044f1290cba0ca6530e6e77cd5da243e74b1
commitizen check.........................................................Failed
- hook id: commitizen
- exit code: 14
commit validation: failed!
please enter a commit message in the commitizen format.
commit "": "fixup! feat: allow easy working"
pattern: (build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\(\S+\))?!?:(\s.*) |
if that's the case, I'm ok with it. @woile what do you think? |
fine by me as well 👍 |
Hey guys, found that issue and as workaround I started using a custom
|
Thanks @wombelix I think it's a great workaround |
Description
It would be nice if
cz check
didn't fail for fixup and squash commits, e.g.,git commit --fixup <rev>
orgit commit --squash <rev>
if the commit messages are otherwise acceptable. In git worflows that use rebase and--autosquash
, the offending commit message portion (squash!
orfixup!
) will be removed. This is especially annoying when commitizen is used withpre-commit
, because every time you do a squash or fixup commit you have toSKIP=commitizen git commit --fixup ...
.Possible Solution
Add a CLI option to
cz check
for this such as--autosquash
or some better name which, if true, prepends the commit message check regex pattern with something liker"((fixup|squash)\!\s)?"
I haven't thought through all of the use cases, but a CLI option may be preferable to a config setting in e.g., toml because you may want the behavior to be different when you are committing (allow) versus pushing or in your CI pipeline (deny). So having something that can be changed a bit more easily than a config option may be desirable. But I hold this opinion lightly.
The text was updated successfully, but these errors were encountered: