diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-12 20:24:16 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-12 20:29:42 +0100 |
commit | 8c5e87852965715389d0bed87eefc663a149f052 (patch) | |
tree | de844bf3e7a3cd54210fb9f0d8ac4e9e677120a8 /.git-hooks | |
parent | 5d388443b9809e73202ce551bcffa10d442094ca (diff) |
git hooks: reject suspicious fdo references
Change-Id: If2302adb662bd2b0d32bacdf9cdc3c0278b86de8
Diffstat (limited to '.git-hooks')
-rwxr-xr-x | .git-hooks/commit-msg | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg index e3dfe6910a18..37ddd1cf87e6 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?" |