One of the arguments against distributed source management systems like Git is that commits on in-progress branches are private and unavailable for review by subscribers to a project's commits mailing list. To help solve this Git is shipped with an example post-commit hook that posts commits to a mailing list.
Email, however, is for old people. Even worse, subscribing to mailing lists is heavyweight, requiring an email address, confirmation of said email address, password reminders, centralized tracking of user preferences and more. More often than not subscribers to commit lists are passive, one-way customers. In short, the syndication model used by blogs in the form of RSS and Atom feeds much more closely matches the way in which most observers want to consume commit list content.
To this end I've put together a git commit hook to post commit logs and diffs to an arbitrary atompub collection. You can grab it here. The code is based on the email post-receive hook packaged with git, but is heavily modified. Some of the comments might still be off, but it should be working for the most part.
As written it is actually designed to be a post-receive hook, run after doing a git-push to a remote repository. For information on setting up a remote git repository, see here.
To begin, you'll need an atompub collection with full write permissions. For information on the setup I used, see here. To set up the commit hook, first download the commit hook script from the link above. Next, on the server hosting your remote repository, do:
chmod +x /path/to/commit/hook/post-receive-atom
cat "/path/to/commit/hook/post-receive-atom" /path/to/git/repository/.git/hooks/post-receive
chmod +x /path/to/git/repository/.git/hooks/post-receive
cd /path/to/git/repository
git repo-config hooks.atomcollection <collection edit link>
git repo-config hooks.atomusername <username>
git repo-config hooks.atompassword <password>
Now, next time you do a git-push to this repository an entry will be posted to the collection you specified. You can see the results of my setup at http://tvachon.info/commits/cosmo.
Technorati Tags: atompub, cosmo, git, syndication, scm, tech