From 2b442ff177751c5ea17e792c10e6d50d7b922b08 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 7 Nov 2009 10:40:22 +0100 Subject: Git commit notifications via post-receive hook Now that we moved our Git repositories to SourceForge, we don't need to maintain local clones for generating commit notifications anymore, as SourceForge provides shell access to the repositories. Instead, we now run git-notify as a post-receive hook on the SourceForge server. Actually, we use a wrapper which executes git-notify with the desired options and which makes it easy to add other post-receive hooks in the future. --- tools/git-post-receive-hook | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tools/git-post-receive-hook (limited to 'tools/git-post-receive-hook') diff --git a/tools/git-post-receive-hook b/tools/git-post-receive-hook new file mode 100755 index 00000000..70d259e7 --- /dev/null +++ b/tools/git-post-receive-hook @@ -0,0 +1,23 @@ +#!/bin/sh + +prefix="${0%/*}/notifications" # $GIT_DIR/hooks/notifications +recipient='Nagios Plugin Commits ' +maxcommits=100 +maxdiffsize=$((300 * 1024)) +gitweburl='http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug' +gitnotify="$prefix/git-notify.pl" +statefile="$prefix/git-notify.dat" + +exec "$gitnotify" \ + -m "$recipient" \ + -n "$maxcommits" \ + -s "$maxdiffsize" \ + -t "$statefile" \ + -u "$gitweburl" \ + -A \ + -C \ + -H \ + -S \ + -T \ + -X \ + -z -- cgit v1.2.3-74-g34f1