summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-03-24 18:01:34 +0100
committerPetr Mladek <pmladek@suse.cz>2012-05-15 13:19:44 +0200
commit1e262c9ffd3d3ff83b0d94f048f6b4653899340c (patch)
treead99a11c3c11fed6b21462faf0e839783918719a
parentcall the gerrit commit-msg hook if present (diff)
downloadcore-1e262c9ffd3d3ff83b0d94f048f6b4653899340c.tar.gz
core-1e262c9ffd3d3ff83b0d94f048f6b4653899340c.zip
git-hooks: commit-msg should not search for whitespace in the diff itself
The additional sed removes every line after seeing the first line starting with a #, just like git will do it later as well. See: http://article.gmane.org/gmane.comp.documentfoundation.libreoffice.devel/26794 Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rwxr-xr-xgit-hooks/commit-msg2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-hooks/commit-msg b/git-hooks/commit-msg
index 378acfa00c57..f2bcb3f13a5a 100755
--- a/git-hooks/commit-msg
+++ b/git-hooks/commit-msg
@@ -57,7 +57,7 @@ fi
# Check for whitespace in front of *'s
-if [ -n "`grep '^[[:space:]]\+\*.*:' $1`" -a -z "`grep '^\*' $1`" ] ; then
+if [ -n "`sed '/^#/,$d' $1 | grep '^[[:space:]]\+\*.*:'`" -a -z "`grep '^\*' $1`" ] ; then
abort "$1" "Please don't use whitespace in front of '* file: Description.' entries."
fi