.. -*- mode: rst -*- .. |date| date:: git-notifier ============ :Version: 0.2-ghc :Home: http://www.icir.org/robin/git-notifier :Author: Robin Sommer :Date: |date| .. contents:: Introduction ------------ ``git-notifier`` is a script to be used with `git `_ as a `post-receive `_ hook. Once installed, it emails out a summary of all changes each time a user pushes an update to the repository. Different from other similar scripts, ``git-notifier`` sends exactly one email per change, each of which includes a complete diff of all modifications as well as the set of branches from which the new revision can be reached. The scripts ensure that that each change is mailed out only exactly once by keeping a state file of already reported revisions. The script integrates nicely with `gitolite `_. Here's example of such a ``git-notifier`` mail:: Subject: [git/git-notifier] master: Adding www target to Makefile. (7dc1f95) Repository : ssh:///git-notifier On branch : master >--------------------------------------------------------------- commit 7dc1f95c97275618d5bde1aaf6760cd7ff6a6ef7 Author: Robin Sommer Date: Sun Dec 19 20:21:38 2010 -0800 Adding www target to Makefile. >--------------------------------------------------------------- Makefile | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index e184c66..9c9951b 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ VERSION = 0.1 DISTFILES = git-notifier README COPYING +WWW = $(HOME)/www/git-notifier + all: dist: @@ -13,3 +15,7 @@ dist: cp $(DISTFILES) git-notifier-$(VERSION) tar czvf git-notifier-$(VERSION).tgz git-notifier-$(VERSION) rm -rf git-notifier-$(VERSION) + +www: dist + rst2html.py README >$(WWW)/index.html + cp git-notifier-$(VERSION).tgz $(WWW) In addition, ``git-notifier`` also mails updates when branches or annotated tags are created or removed; and it furthermore mails a revision summary if a head moves to now include commits already reported previously (e.g., on fast-forwards). If a commit message contains ``[nodiff]``, the generated mail will not include a diff. If a commit message contains ``[nomail]``, no mail will be send for that change. Download -------- You can download the current version here: http://www.icir.org/robin/git-notifier/git-notifier-0.2.tar.gz History ------- The `CHANGES `_ file records recent updates to ``git-notifier``. Installation ------------ The basic installation is simple: just run the script from ``hooks/post-receive``, as in:: #!/bin/sh /full/path/to/git-notifier By default, the script will send its mails to the user running the ``git-notifier`` (i.e., the one doing the update). As that's usually not the desired recipient, an alternative email address can be specified via command line or git options, see the ``mailinglist`` option below. Usage ----- ``git-notifier`` supports the options below. Alternatively to giving them on the command line, all of them can alse be set via ``git config hooks.