Skip to content

fix: bail if the commit message use a fixup! prefix #32

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

Merged
merged 1 commit into from
Jul 12, 2025

Conversation

aegypius
Copy link
Contributor

@aegypius aegypius commented Mar 4, 2025

First of all, thanks for your work !

When I use the --fixup option the issue number keep repeating itself each time. As a reminder "fixup" commit reference the targeted commit message (which may already contain the issue number), regardless of if the issue number is present or not, --autosquash feature combine commits with the exact same message.

This PR bails on every message starting with fixup! tag (documentation)

Verified

This commit was signed with the committer’s verified signature.
aegypius Nicolas LAURENT
# Bail if commit message already contains tickets
if any(re.search(regex, content) for content in contents):
# Bail if commit message starts with “fixup!” or commit message already contains tickets
if commit_msg.startswith('fixup!') or any(re.search(regex, content) for content in contents):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be anything else than "fixup!? Assuming it always will be, if not, could make it configurable in pre commit config. If its the former then I think its fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is indeed the amend! prefix too in the documentation, I don't think it's configurable by any means

Neither "fixup!" nor "amend!" commits change authorship of when applied by git rebase --autosquash. See git-rebase[1] for details.

source

@milind-shakya-sp milind-shakya-sp merged commit bf11566 into milin:master Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants