From a376ff7b784c4631138c2fe9b9c69054ac150480 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 16 Oct 2024 14:24:04 +0200 Subject: [PATCH] hooks:commit-msg: Relax subject length limit to 60 There is no need to be that pedantic. --- meta/git/hooks/commit-msg | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/git/hooks/commit-msg b/meta/git/hooks/commit-msg index a25f047..3d300aa 100755 --- a/meta/git/hooks/commit-msg +++ b/meta/git/hooks/commit-msg @@ -37,7 +37,11 @@ body="$( /^[^${git_comment_char/auto/\#}]/p" )" -[[ ${#subject} -le 50 ]] || die "Subject too long. (<= 50)" +if [[ ${#subject} -gt 60 ]]; then + die "Subject too long. (<= 60)" +elif [[ ${#subject} -gt 50 ]]; then + >&2 printf "%s: Subject exceeds recommendation of 50 characters!\n" "$0" +fi # The subject line has to match "${pats[@]}", but to be more verbose different # error messages are printed for the different 'levels' of the pattern.