<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Underhill &#187; post-receive</title>
	<atom:link href="http://dound.com/tag/post-receive/feed/" rel="self" type="application/rss+xml" />
	<link>http://dound.com</link>
	<description>dound&#039;s space on the web</description>
	<lastBuildDate>Tue, 31 Jan 2012 10:57:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>github: Send e-mail on push</title>
		<link>http://dound.com/2009/05/github-send-e-mail-on-push/</link>
		<comments>http://dound.com/2009/05/github-send-e-mail-on-push/#comments</comments>
		<pubDate>Sun, 31 May 2009 13:56:37 +0000</pubDate>
		<dc:creator>David Underhill</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[post-receive]]></category>

		<guid isPermaLink="false">http://dound.com/?p=176</guid>
		<description><![CDATA[I&#8217;ve been looking for a way to have github, my favorite repository hosting service, send emails to interested parties whenever someone pushes new commits into the repository, They don&#8217;t seem to provide this service directly, but they do provide both an API for programatically querying the site as well as post-receive callbacks. The latter sends [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for a way to have <a href="https://github.com/">github</a>, my favorite repository hosting service, send emails to interested parties whenever someone pushes new commits into the repository,  They don&#8217;t seem to provide this service directly, but they do provide both an <a href="http://develop.github.com/">API</a> for programatically querying the site as well as <a href="http://www.kernel.org/pub/software/scm/git/docs/githooks.html">post-receive</a> callbacks.  The latter sends a POST request to URL(s) of your choice.  The POST request includes <a href="http://www.json.org/">JSON</a> data which contains information about the repository and the new commits (for details, <a href="http://github.com/guides/post-receive-hooks">see here</a>).  Using this, I was able to put together a relatively simple <a href="http://www.php.net/">PHP</a> script which repackages this information into a human-readable form and sends it off in an email (<b><a href="https://github.com/dound/github-post-receive-php-handler/tree">source code here</a></b>).</p>
<p>I wanted to use the github API to get a list of those who watch the project, and then send an email to those people.  Unfortunately the API does not let you query that yet.  Instead, my script lets you specify the recipients manually.  Alternatively, a simple mailing list implementation is provided so people can sign up for the post-receive emails through a webpage instead.</p>
<p>The only downside is that the JSON github provides does not include information about how many lines were modified, just files.  In this respect, <a href="http://git.kernel.org/?p=git/git.git;a=history;f=contrib/hooks/post-receive-email">Andy Parkin&#8217;s post-receive</a> script produces slightly more informative e-mails (but of course it doesn&#8217;t work with github).</p>
]]></content:encoded>
			<wfw:commentRss>http://dound.com/2009/05/github-send-e-mail-on-push/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

