From 371134264aadeab863cd5ec0dc292d4f9125d172 Mon Sep 17 00:00:00 2001
From: Pekka Nikander <pekka.nikander@iki.fi>
Date: Wed, 10 Oct 2018 13:39:38 +0300
Subject: [PATCH] dist/tools/commit-msg/check.sh: Enhance reporting

---
 dist/tools/commit-msg/check.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dist/tools/commit-msg/check.sh b/dist/tools/commit-msg/check.sh
index f0dfef29c6..52caa8de22 100755
--- a/dist/tools/commit-msg/check.sh
+++ b/dist/tools/commit-msg/check.sh
@@ -35,11 +35,15 @@ ERROR="$(git log \
         msg_length=$(echo "${msg}" | awk '{print length($0)}')
 
         if [ ${msg_length} -gt ${MSG_MAX_LENGTH} ]; then
-            echo "Commit message is longer than ${MSG_MAX_LENGTH} characters:" >&2
-            echo "    \"${msg}\"" >&2
             if [ ${msg_length} -gt ${MSG_STRETCH_LENGTH} ]; then
+                MSG="Error: Commit message is longer than ${MSG_STRETCH_LENGTH} characters:"
                 echo "error"
+            else
+                MSG="Warning: Commit message is longer than ${MSG_MAX_LENGTH}"
+                MSG="${MSG} (but < ${MSG_STRETCH_LENGTH}) characters:"
             fi
+            echo "${MSG}" >&2
+            echo "    \"${msg}\"" >&2
         fi
     done)"
 
-- 
GitLab