aboutsummaryrefslogtreecommitdiffstats
path: root/modules/subversion
diff options
context:
space:
mode:
Diffstat (limited to 'modules/subversion')
-rw-r--r--modules/subversion/manifests/init.pp8
-rw-r--r--modules/subversion/templates/single_word_commit12
2 files changed, 20 insertions, 0 deletions
diff --git a/modules/subversion/manifests/init.pp b/modules/subversion/manifests/init.pp
index 1486fbca..d78a93d1 100644
--- a/modules/subversion/manifests/init.pp
+++ b/modules/subversion/manifests/init.pp
@@ -74,6 +74,14 @@ class subversion {
content => template('subversion/no_empty_message')
}
+ file { "$local_dir/pre-commit.d/single_word_commit":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 755,
+ content => template('subversion/single_word_commit')
+ }
+
file { "$local_dir/pre-revprop-change":
ensure => present,
owner => root,
diff --git a/modules/subversion/templates/single_word_commit b/modules/subversion/templates/single_word_commit
new file mode 100644
index 00000000..1b0ff8a5
--- /dev/null
+++ b/modules/subversion/templates/single_word_commit
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+REP="$1"
+TXN="$2"
+
+LOG=$(svnlook log -t "$TXN" "$REP")
+
+if ! echo "$LOG" | grep -qvP '^\s*\b\S+\b\s*$'; then
+ echo "one word commit message not allowed" >&2
+ exit 1
+fi
+