aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--deployment/mgagit/manifests/init.pp4
-rw-r--r--deployment/mgagit/templates/format-commit-email.sh19
-rw-r--r--deployment/mgagit/templates/group_owned_repo.gl2
-rw-r--r--deployment/mgagit/templates/repodef_repo.gl2
4 files changed, 25 insertions, 2 deletions
diff --git a/deployment/mgagit/manifests/init.pp b/deployment/mgagit/manifests/init.pp
index 7f25478b..94024446 100644
--- a/deployment/mgagit/manifests/init.pp
+++ b/deployment/mgagit/manifests/init.pp
@@ -41,6 +41,10 @@ class mgagit(
require => Package['mgagit'],
}
+ mga_common::local_script { 'mgagit-format-commit-email':
+ content => template('mgagit/format-commit-email.sh'),
+ }
+
file { $gitolite_tmpldir:
ensure => directory,
owner => root,
diff --git a/deployment/mgagit/templates/format-commit-email.sh b/deployment/mgagit/templates/format-commit-email.sh
new file mode 100644
index 00000000..f41c3fce
--- /dev/null
+++ b/deployment/mgagit/templates/format-commit-email.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+REV=$1
+if [ -z "$1" ]; then
+ echo "Unknown Commit"
+ exit
+fi
+if [ -z "$GL_REPO" ]; then
+ echo "Cannot find Gitolite Repository"
+ exit
+fi
+
+echo '-----------------------------------------------------------------------'
+echo
+echo "http://gitweb.mageia.org/$GL_REPO/commit/?id=$REV"
+echo
+echo
+git show -C $REV
+echo
diff --git a/deployment/mgagit/templates/group_owned_repo.gl b/deployment/mgagit/templates/group_owned_repo.gl
index b785b55c..bbaaa491 100644
--- a/deployment/mgagit/templates/group_owned_repo.gl
+++ b/deployment/mgagit/templates/group_owned_repo.gl
@@ -23,7 +23,7 @@ repo [% repo %]
[% END -%]
config hooks.emailprefix = "[[% repo %]] "
config hooks.envelopesender = "root@mageia.org"
- config hooks.showrev = "t=%s; echo '-----------------------------------------------------------------------';echo; printf 'http://gitweb.mageia.org/'$GL_REPO'/commit/?id=%%s' $t; echo;echo; git show -C $t; echo"
+ config hooks.showrev = "/usr/local/bin/mgagit-format-commit-email %s"
config gitweb.description = "[% r.repos.$repo.description %]"
[% IF r.users.$maintainer -%]
config gitweb.owner = "[% r.users.$maintainer.cn.0 %] [[% maintainer %]]"
diff --git a/deployment/mgagit/templates/repodef_repo.gl b/deployment/mgagit/templates/repodef_repo.gl
index ceb523e0..883ded33 100644
--- a/deployment/mgagit/templates/repodef_repo.gl
+++ b/deployment/mgagit/templates/repodef_repo.gl
@@ -5,5 +5,5 @@ repo [% repo %]
config hooks.mailinglist = "sysadmin-commits@ml.mageia.org"
config hooks.emailprefix = "[[% repo %]] "
config hooks.envelopesender = "root@mageia.org"
- config hooks.showrev = "t=%s; echo '-----------------------------------------------------------------------';echo; printf 'http://gitweb.mageia.org/'$GL_REPO'/commit/?id=%%s' $t; echo;echo; git show -C $t; echo"
+ config hooks.showrev = "/usr/local/bin/mgagit-format-commit-email %s"
config gitweb.description = "[% r.repos.$repo.description %]"