[Nagiosplug-devel] Git commit e-mails

Holger Weiss holger at CIS.FU-Berlin.DE
Fri May 22 02:22:58 CEST 2009


The commit e-mails posted on <nagiosplug-checkins at lists.sourceforge.net>
are currently still generated via the Subversion mirror of our Git
repository.  Since we don't want to rely on the Subversion mirror
forever, I prepared a setup which would send out such e-mails directly
from Git, instead.

These e-mails would look different than before, though.  Only one e-mail
per push would be generated, not one e-mail per commit.  More precisely:
every <n> (e.g., 5) minutes, a script would generate one e-mail for each
branch or tag which points to a different object than it did <n> minutes
ago, or which was created or deleted during that interval.  This e-mail
would report all changes for the given branch or tag.  Usually, it would
list the log message and the author/committer of any new commits, as
well as a single diff which shows the effect of all listed commits (up
to a size of currently 300 KiB).  Here's an example e-mail which reports
two commits on the master branch:

ftp://ftp.in-berlin.de/pub/users/weiss/nagios/plugins/commit-mails/example.txt

Please let me know if you have any suggestions for improvements.  In
particular, I'm unsure about the case where multiple commits are
reported in a single e-mail (as in this example). While I personally
like seeing all log messages at the top of the e-mail followed by a
single diff, I guess others might prefer separate diffs for each commit,
so that the code changes are matched with the log messages.  That is:

	* Log message of commit A
	* Diff A^..A
	* Log message of commit B
	* Diff B^..B
	* Log message of commit C
	* Diff C^..C

instead of:

	* Log message of commit A
	* Log message of commit B
	* Log message of commit C
	* Diff A^..C

Both options have pros and cons, so let me know what you'd prefer.  Or,
as another alternative, should we simply continue to send a separate
e-mail for each commit?

In case you're interested, here's is the script which would do the job
(via Cron) by updating a mirror of the Git repository, remembering which
refs have changed, and then executing a modified version¹ of the
post-receive-email script² provided with Git:

ftp://ftp.in-berlin.de/pub/users/weiss/nagios/plugins/commit-mails/mirror.sh

Holger

¹ ftp://ftp.in-berlin.de/pub/users/weiss/nagios/plugins/commit-mails/post-receive-email.diff
² http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/hooks/post-receive-email




More information about the Devel mailing list