[misc] Tighten commit-msg hook

This commit is contained in:
Thomas Lindner 2020-07-09 17:09:30 +02:00 committed by acipm
parent 0e53b900c0
commit 3f233bda6e

View file

@ -6,8 +6,9 @@
#
# client-side git-hook - checks commit message style
head -n 1 "$1" | egrep -x '\[[^]]+\] [[:upper:]].*[^.]' > /dev/null
pattern='\[(core|frontend|twitter|telegram|email|xmpp|mastodon|tests|doc|misc)\] [[:upper:]].*[^.]'
head -n 1 "$1" | egrep -x "$pattern" > /dev/null
if [ $? -ne 0 ]; then
echo "commit message doesn't match style" >&2
echo "commit message doesn't match \"$pattern\"" >&2
exit 1
fi