[Libreoffice-commits] core.git: .git-hooks/commit-msg

Miklos Vajna vmiklos at collabora.co.uk
Thu Feb 12 11:30:19 PST 2015


 .git-hooks/commit-msg |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 8c5e87852965715389d0bed87eefc663a149f052
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Feb 12 20:24:16 2015 +0100

    git hooks: reject suspicious fdo references
    
    Change-Id: If2302adb662bd2b0d32bacdf9cdc3c0278b86de8

diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg
index e3dfe69..37ddd1c 100755
--- a/.git-hooks/commit-msg
+++ b/.git-hooks/commit-msg
@@ -45,6 +45,13 @@ 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."
 fi
 
+fdo_regex='fdo#[0-9]+'
+if egrep -q "$fdo_regex" $1; then
+    if [ "`head -n 1 $1 |egrep -o "$fdo_regex" |sed 's/fdo#//'`" -gt 88775 ]; then
+        abort "$1" "The first line contains a suspicious fdo# rereference, did you mean tdf#?"
+    fi
+fi
+
 # ...and that it does not continue on the second line
 if [ "`wc -l < $1`" -gt 1 -a -n "`head -n 2 $1 | tail -n 1 | sed 's/^#.*//'`" ] ; then
     abort "$1" "The second line is not empty - maybe the first line continues there?"


More information about the Libreoffice-commits mailing list