Skip to content

Conversation

@hjmjohnson
Copy link
Member

The pre-commit hook for checking commit messages was not being
executed.

The commit-msg hook was never used. The kw-commit-msg hook seems
to be the script to use.

Removed commit-msg and migrated useful components to kw-commit-msg.

PR Checklist

NOTES

The following copies in other projects may also need to be updated.

SimpleITK/Utilities/Hooks/kw-commit-msg
ITK/Utilities/Hooks/kw-commit-msg
SphinxExamples-bld/ITK/Utilities/Hooks/kw-commit-msg

The github 'ghostworkflow' fails when the subject
line is greater than 78 characters in length.

Add a check to enforce the subject line length
during initial commit when it is easy to fix.

The function 'hooks_config' does not exist, so it
always failed and prevented the script from performing
the intended task.

The testing for correct ITK commit prefix
was migrated form commit-msg to this script.
The commit-msg script is never used.  It was replaced with
kw-commit-msg script that is called for pre-commit.
@github-actions github-actions bot added type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots labels Jun 21, 2025
@dzenanz
Copy link
Member

dzenanz commented Jun 23, 2025

#5434 seems like a duplicate of this?

@hjmjohnson
Copy link
Member Author

#5434 seems like a duplicate of this?

It is not a duplicate of the previous. This PR is fixing the bash script with bash commands, and these fixes are immediately useful in other tools that use kw-commit-msg (i.e. SphinxExamples, SimpleITK, ..).

The #5434 is a conversion from bash to python. If #5434 is rejected, this PR is essential.

@hjmjohnson hjmjohnson requested a review from thewtex June 23, 2025 14:53
Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

Thanks @hjmjohnson 👍

@thewtex thewtex merged commit b4f8ec6 into master Jun 23, 2025
17 checks passed
@thewtex thewtex deleted the fix-kw-commit-msg-checking branch June 23, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants