Skip to content
Snippets Groups Projects
Commit 37113426 authored by Pekka Nikander's avatar Pekka Nikander
Browse files

dist/tools/commit-msg/check.sh: Enhance reporting

parent a95957e5
No related branches found
No related tags found
No related merge requests found
...@@ -35,11 +35,15 @@ ERROR="$(git log \ ...@@ -35,11 +35,15 @@ ERROR="$(git log \
msg_length=$(echo "${msg}" | awk '{print length($0)}') msg_length=$(echo "${msg}" | awk '{print length($0)}')
if [ ${msg_length} -gt ${MSG_MAX_LENGTH} ]; then 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 if [ ${msg_length} -gt ${MSG_STRETCH_LENGTH} ]; then
MSG="Error: Commit message is longer than ${MSG_STRETCH_LENGTH} characters:"
echo "error" echo "error"
else
MSG="Warning: Commit message is longer than ${MSG_MAX_LENGTH}"
MSG="${MSG} (but < ${MSG_STRETCH_LENGTH}) characters:"
fi fi
echo "${MSG}" >&2
echo " \"${msg}\"" >&2
fi fi
done)" done)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment