Meta: Ignore everything after the git cut line in a lint-commit.sh hook

I have set up a commit.verbose variable in my git config,
which shows the patch diff on bottom of the commit message.

Unfortunately the character limit was also applied to the diff,
which meant that I got a false-positive lint error almost every time.
This commit is contained in:
Karol Kosek
2021-07-27 22:12:33 +02:00
committed by Linus Groh
parent 2f8eb4f068
commit 220dd28b02

View File

@@ -17,6 +17,11 @@ fi
line_number=0
while read -r line; do
# break on git cut line, used by git commit --verbose
if [[ "$line" == "# ------------------------ >8 ------------------------" ]]; then
break
fi
# ignore comment lines
[[ "$line" =~ ^#.* ]] && continue