hooks:commit-msg: Allow links being overly long

Allow links on single lines and in git trailers.
This commit is contained in:
2025-08-04 17:16:55 +02:00
parent 8380d4cc29
commit 4a12ed8567

View File

@@ -68,6 +68,11 @@ BKP_IFS="$IFS"
IFS='
'
for line in $body; do
[[ ${#line} -le 72 ]] || die "Body lines too long. (<= 72)"
[[ ${#line} -gt 72 ]] || continue
# Allow links on single lines and in trailers
[[ ! $line =~ ^([-A-Za-z0-9]*:)?[\ \ ]*https?://[^\ ]*$ ]] || continue
die "Body lines too long. (<= 72)"
done
IFS="$BKP_IFS"