<?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>The Developer Day &#187; pre-commit</title>
	<atom:link href="http://www.thedeveloperday.com/tag/pre-commit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thedeveloperday.com</link>
	<description>Staying Curious</description>
	<lastBuildDate>Fri, 03 Feb 2012 12:03:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using pre commit hooks to integrate SVN with project management tools</title>
		<link>http://www.thedeveloperday.com/using-pre-commit-hooks-to-integrate-svn-with-project-management-tools/</link>
		<comments>http://www.thedeveloperday.com/using-pre-commit-hooks-to-integrate-svn-with-project-management-tools/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 14:15:16 +0000</pubDate>
		<dc:creator>Žilvinas Šaltys</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[hooks]]></category>
		<category><![CDATA[post-commit]]></category>
		<category><![CDATA[pre-commit]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.thedeveloperday.com/using-pre-commit-hooks-to-integrate-svn-with-project-management-tools/</guid>
		<description><![CDATA[Most developer teams work with version control tools like SVN or Git. Most of those teams use certain project management tools like Basecamp or Fogbugz in our case. We came up with an idea to require developers to write down SVN revision numbers in commit messages. This helps to relate code changes to actual tasks if [...]]]></description>
			<content:encoded><![CDATA[<p>Most developer teams work with version control tools like <a title="subversion" href="http://subversion.tigris.org/">SVN</a> or <a title="git fast version control" href="http://git-scm.com/">Git</a>. Most of those teams use certain project management tools like <a title="basecamp project management tool" href="http://www.basecamphq.com/">Basecamp</a> or <a title="fogbugz project management" href="http://www.fogcreek.com/FogBUGZ/">Fogbugz</a> in our case.</p>
<p>We came up with an idea to require developers to write down SVN revision numbers in commit messages. This helps to relate code changes to actual tasks if such a need arises. To do that we&#8217;ve created a pre commit hook that requires developers to insert internal project management tool task number to the SVN commit comment field.</p>
<p>A pre commit hook can be a simple bash script. In our case it was this script:</p>
<pre name="code" class="bash:nogutter">#!/bin/sh
REPOS="$1"
TXN="$2
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK info -t "$TXN" "$REPOS" | grep -P 'FB:\s*\d{3,6}' &gt; /dev/null
if [ $? -ne 0 ]; then
echo -e "FogBugz case number is missing in the comment.\n" 1&gt;&amp;2
echo -e "Please add text 'FB: CASE_NUMBER' to your comment." 1&gt;&amp;2
exit 1
fi
exit 0</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.thedeveloperday.com/using-pre-commit-hooks-to-integrate-svn-with-project-management-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

