aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-07-05 00:02:55 +0000
committerMichael Scherer <misc@mageia.org>2011-07-05 00:02:55 +0000
commitf625d58072505811c8cc1ccdc769b6ab676cf0b9 (patch)
tree5603fbd18df4561d99333123c61b0c9810e83301 /modules
parent7b1dcb6925ac84c628f2efd0eb08a9ea78fe9e5e (diff)
downloadpuppet-f625d58072505811c8cc1ccdc769b6ab676cf0b9.tar
puppet-f625d58072505811c8cc1ccdc769b6ab676cf0b9.tar.gz
puppet-f625d58072505811c8cc1ccdc769b6ab676cf0b9.tar.bz2
puppet-f625d58072505811c8cc1ccdc769b6ab676cf0b9.tar.xz
puppet-f625d58072505811c8cc1ccdc769b6ab676cf0b9.zip
prototype of script to prevent one word commit
Diffstat (limited to 'modules')
-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
+