From 4a12ed8567c6169b64ee19ad2f3d71e9102b75bc Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 4 Aug 2025 17:16:55 +0200 Subject: [PATCH] hooks:commit-msg: Allow links being overly long Allow links on single lines and in git trailers. --- meta/git/hooks/commit-msg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/git/hooks/commit-msg b/meta/git/hooks/commit-msg index d9beda3..df5d961 100755 --- a/meta/git/hooks/commit-msg +++ b/meta/git/hooks/commit-msg @@ -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"