aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2023-09-25 21:38:57 +0200
committerRobin Jarry <robin@jarry.cc>2023-09-27 21:21:05 +0200
commit439204d994e8ba9ab3045139bc716bee812f4029 (patch)
tree85cc6ae3ece59327960dcb715dac2151bddd4bcf
parent01ccccbf24a8e453e036bf08b7052ac47baa1ff7 (diff)
downloadaerc-439204d994e8ba9ab3045139bc716bee812f4029.tar.gz
check-patches: complain if title is longer than 72 characters
Although git commit titles can be a lot longer that 72 characters it is sensible to limit it somewhere. Many people recommend a maximum of 50 characters, other places allow for slightly longer, github for examples truncates titles at 72, our benevolent maintainer tries to aim for 60. Considering the above 72 seems like a comfortable hard limit. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
-rwxr-xr-xcontrib/check-patches5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/check-patches b/contrib/check-patches
index 3ae2e834..e0d82896 100755
--- a/contrib/check-patches
+++ b/contrib/check-patches
@@ -16,6 +16,11 @@ for rev in $(git rev-list --reverse "$revision_range"); do
title=$(git log --format='%s' -1 "$rev")
fail=false
+ if [ "$(echo "$title" | wc -m)" -gt 72 ]; then
+ echo "error [PATCH $n/$total] '$title' title is longer than 72 characters, please make it shorter" >&2
+ fail=true
+ fi
+
author=$(git log --format='%an <%ae>' -1 "$rev")
if ! git log --format="%(trailers:key=Signed-off-by,only,valueonly)" -1 "$rev" |
grep -qFx "$author"; then