Skip to content

Commit 7d31c4f

Browse files
committed
Add support for verbose commits
Break the reading of commit message lines if we find a cut line. This makes the validator ignore lines part of the commit diff in verbose mode. Which will make the check faster, and not give warnings if lines in your code exceed 72 characters.
1 parent 9e432db commit 7d31c4f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hook.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ read_commit_message() {
111111
REPLY="${REPLY%%*( )}"
112112
shopt -u extglob
113113

114+
# ignore all lines after cut line
115+
[[ $REPLY == "# ------------------------ >8 ------------------------" ]]
116+
test $? -eq 1 || break
117+
114118
# ignore comments
115119
[[ $REPLY =~ ^# ]]
116120
test $? -eq 0 || COMMIT_MSG_LINES+=("$REPLY")

0 commit comments

Comments
 (0)