Skip to content

Commit 0f77fdc

Browse files
committed
feat: Give a hint on how to reedit the commit message
I think it is not common knowledge that the commit message is stored in `.git/COMMIT_EDITMSG` if the hook fails. Let's give the user a hint and a copy-pastable command to retry the commit.
1 parent 50c461e commit 0f77fdc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

conventional_pre_commit/hook.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ def main(argv=[]):
7575
{Colors.YELLOW}Your commit message does not follow Conventional Commits formatting
7676
{Colors.LBLUE}https://www.conventionalcommits.org/{Colors.YELLOW}
7777
78+
Run
79+
git commit --edit --file=.git/COMMIT_EDITMSG
80+
to reedit the commit message do the commit.
81+
7882
Conventional Commits start with one of the below types, followed by a colon,
7983
followed by the commit subject and an optional body seperated by a blank line:{Colors.RESTORE}
8084

0 commit comments

Comments
 (0)