summaryrefslogtreecommitdiff
path: root/.git-hooks/commit-msg
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-06-05 11:56:32 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-06-05 21:34:15 +0200
commit058c54d540950426751dcb4a00f2488e6375e05a (patch)
tree2357a053aa4e56d0893e4602728c49d4fc8b36a7 /.git-hooks/commit-msg
parent722041b43bd578ec9f6daeb716309d2ead4ea1a4 (diff)
git-hooks: show length of first line if it's too long
Change-Id: I164e4308c2a3e685bbc83cfde1cae5189839075e Reviewed-on: https://gerrit.libreoffice.org/73556 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to '.git-hooks/commit-msg')
-rwxr-xr-x.git-hooks/commit-msg5
1 files changed, 3 insertions, 2 deletions
diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg
index cf52ce307dda..64fb7924956b 100755
--- a/.git-hooks/commit-msg
+++ b/.git-hooks/commit-msg
@@ -41,8 +41,9 @@ fi
# ...and that it is not too long
-if [ "`head -n 1 $1 | wc -c`" -gt 79 ] ; then
- abort "$1" "The first line is too long, please try to fit into 79 characters."
+len="`head -n 1 $1 | wc -c`"
+if [ "$len" -gt 79 ] ; then
+ abort "$1" "The first line is $len characters, please try to fit into 79 characters."
fi
fdo_regex='fdo#[0-9]+'