diff --git a/manifests/init.pp b/manifests/init.pp index 9686cb0..a6b3873 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -129,6 +129,14 @@ # 'scheme' => ['ssh', 'anon_http', 'anon_git'], # 'archive' => ['tar', 'tbz2', 'tgz', 'txz'], # }, +# commitmessage_params: +# A dict of commit message parameters, valid params are: maxLineLength, +# longLinesThreshold, rejectTooLong, and maxSubjectLength. +# Example: +# commitmessage_params => { +# maxSubjectLength => '60', +# maxLineLength => '72', +# }, # java_home: # The path to java home directory # TODO: make more gerrit options configurable here @@ -227,6 +235,7 @@ class gerrit( $cache_diff_timeout = '', $cache_diff_intraline_timeout = '', $download = {}, + $commitmessage_params = {}, $java_home = '/usr/lib/jvm/java-7-openjdk-amd64/jre', ) { include ::httpd @@ -407,6 +416,7 @@ class gerrit( # - $cache_diff_timeout # - $cache_diff_intraline_timeout # - $download + # - $commitmessage_params file { '/home/gerrit2/review_site/etc/gerrit.config': ensure => present, diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp index 9ba3808..e57a9b9 100644 --- a/spec/acceptance/fixtures/default.pp +++ b/spec/acceptance/fixtures/default.pp @@ -33,6 +33,13 @@ class { '::gerrit': ssh_replication_rsa_pubkey_contents => file('/tmp/gerrit-ssh-keys/ssh_replication_rsa_key.pub'), secondary_index => true, secondary_index_type => 'LUCENE', + commitmessage_params => + { + maxSubjectLength => '60', + maxLineLength => '72', + longLinesThreshold => '20', + rejectTooLong => 'true', + }, } class { '::gerrit::cron': } diff --git a/templates/gerrit.config.erb b/templates/gerrit.config.erb index 8b522ae..3ac6b06 100644 --- a/templates/gerrit.config.erb +++ b/templates/gerrit.config.erb @@ -193,6 +193,14 @@ <% end -%> <% end -%> <% end -%> +<% unless @commitmessage_params.nil? or @commitmessage_params.empty? -%> +[commitmessage] + <% @commitmessage_params.each do |key, value| -%> + <% if key == "maxLineLength" or key == "longLinesThreshold" or key == "rejectTooLong" or key == "maxSubjectLength" -%> + <%= key %> = <%= value %> + <% end -%> + <% end -%> +<% end -%> [groups] newGroupsVisibleToAll = <%= @new_groups_visible_to_all %> [mimetype "image/*"]