Commit 292d3ac
authored
fix: modify commit-msg hook to work with verbose commits (#782)
Small suggestion for the commit-msg hook to strip everything below the scissor line (added by [`git commit -v`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---verbose)) before stripping all of the comments. If this doesn't get stripped the commit message will never be detected as empty because of the diff below the scissor line (which are not comments).
This change is merely a suggestion, feel free to take it and modify it as you see fit. Preferably it would also check the `--cleanup`/`git config commit.cleanup` option and only strip as much as that specifies but that's maybe something for in the future.
Tested `git commit` with and without `-v`, and with and without a commit message.1 parent 90d3adf commit 292d3ac
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments