<?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>VolkomenJuist.nl &#187; Subversion</title>
	<atom:link href="http://www.volkomenjuist.nl/blog/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.volkomenjuist.nl/blog</link>
	<description>Juist! Volkomen Juist!</description>
	<lastBuildDate>Mon, 18 Jul 2011 20:00:14 +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>Subversion pre-commit hook</title>
		<link>http://www.volkomenjuist.nl/blog/2009/03/13/subversion-pre-commit-hook/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/03/13/subversion-pre-commit-hook/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 20:25:50 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Subversion]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[pre-commit]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=211</guid>
		<description><![CDATA[When you commit a file or files to your repository it&#8217;s not, by default, required to fill in a message or comment. If you want to force your users to do so. then you can use the pre-commit hook. A pre-commit hook is a script which will be evaluated and if everything is fine then it will [...]]]></description>
			<content:encoded><![CDATA[<p>When you commit a file or files to your repository it&#8217;s not, by default, required to fill in a message or comment. If you want to force your users to do so. then you can use the pre-commit hook. A pre-commit hook is a script which will be evaluated and if everything is fine then it will exit with code 0 and commits the file(s). This script is very powerfull and can be written in different languages like Python, Perl or Bash. This article describes a simple pre-commit hook. </p>
<p><span id="more-211"></span> After <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy52b2xrb21lbmp1aXN0Lm5sL2Jsb2cvMjAwOS8wMy8xMS9zdWJ2ZXJzaW9uLW9uLXN5bm9sb2d5LWRzMjA5Lw==">installing </a>Subversion a folder <code>/volume1/svn/repositories/hooks</code> was created. This folder contains several template files (ending with .tmpl). If you want you can use one of these pre-defined templates. We are going to adjust the pre-commit.tmpl in such way that it won&#8217;t allow users to commit files without a comment.</p>
<p>1. Go to <code>cd /volume1/svn/repositories/hooks</code><br />
2. Type <code>cp pre-commit.tmpl pre-commit</code> to copy the template file to a new file without the .tmpl extension.<br />
3. Open the file with the build-in VI editor. To do this type <code>vi pre-commit</code><br />
4. Search for a string which looks like <code>$SVNLOOK log -t "$TXN" "$REPOS" | \ grep "[a-zA-Z0-9]" &gt; /dev/null || exit 1 </code>. You can use the arrows. This piece of code already checks whether a comment has been filled in but won&#8217;t give you the reason why it couldn&#8217;t commit.<br />
5. Now press (SHIFT + A). This will jump to the end of the line. VI editor is now in &#8220;edit&#8221; mode.<br />
6. Change that line to
<pre class="brush: java; title: ; notranslate">$SVNLOOK log -t &quot;$TXN&quot; &quot;$REPOS&quot; | \
grep &quot;[a-zA-Z0-9]&quot; &gt; /dev/null || { echo &quot;&lt;&lt;Empty Log Message&gt;&gt;&quot; &gt;&amp;2; exit 1;} </pre>
<p>It will check if a comment is filled in, otherwise it will exit with exit code 1. If all checks passed then the script will exit with exit code 0.<br />
7. Press ESC to get out the &#8220;edit&#8221; mode.<br />
8. Type <code>:wq</code> to save the file and exit the VI editor.<br />
9. Type <code>chmod u+x pre-commit</code> to set the right permissions, otherwise you will get an exit code 255, instead of the desired exit code 1.<br />
10. Now try to commit without a comment you will get something like the screenshot below.</p>
<p><img class="aligncenter size-full wp-image-212" title="Force Comment" src="http://www.volkomenjuist.nl/blog/wp-content/uploads/2009/03/forcecomment.jpg" alt="Force Comment" width="659" height="295" /></p>
<p>You can also download more examples or pre-written scripts, <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N2bi5jb2xsYWIubmV0L3JlcG9zL3N2bi90cnVuay90b29scy9ob29rLXNjcmlwdHMv">here</a> and<br />
<a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N2bi5jb2xsYWIubmV0L3JlcG9zL3N2bi90cnVuay9jb250cmliL2hvb2stc2NyaXB0cy8=">here.</a></p>
<p>Complete script (Without comments)</p>
<pre class="brush: java; title: ; notranslate">#!/bin/sh

REPOS=&quot;$1&quot;
TXN=&quot;$2&quot;

# Make sure that the log message contains some text.
SVNLOOK=/opt/bin/svnlook
$SVNLOOK log -t &quot;$TXN&quot; &quot;$REPOS&quot; | \
   grep &quot;[a-zA-Z0-9]&quot; &gt; /dev/null || { echo &quot;&lt;&lt;Empty log message&gt;&gt;&quot; &gt;&amp; 2; exit 1; }

# All checks passed, so allow the commit.
exit 0
</pre>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=211" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/03/13/subversion-pre-commit-hook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Subversion on Synology DS209+</title>
		<link>http://www.volkomenjuist.nl/blog/2009/03/11/subversion-on-synology-ds209/</link>
		<comments>http://www.volkomenjuist.nl/blog/2009/03/11/subversion-on-synology-ds209/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 20:47:55 +0000</pubDate>
		<dc:creator>Stefanovich</dc:creator>
				<category><![CDATA[Synology]]></category>
		<category><![CDATA[DS209+]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.volkomenjuist.nl/blog/?p=204</guid>
		<description><![CDATA[Today I installed Subversion on my Synology DS209+ NAS. A very good point to start is this step-by-step tutorial written by the guys of Synology. Installing Subversion was/is very easy because there is an IPKG package available which will download and configure all dependencies for you. If you don&#8217;t know how to install IPKG, just read this blog. To [...]]]></description>
			<content:encoded><![CDATA[<p>Today I installed <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TdWJ2ZXJzaW9uXyhzb2Z0d2FyZSk=" target=\"_blank\">Subversion</a> on my Synology DS209+ NAS. A very good point to start is <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zeW5vbG9neS5jb20vd2lraS9pbmRleC5waHAvU3RlcC1ieS1zdGVwX2d1aWRlX3RvX2luc3RhbGxpbmdfU3VidmVyc2lvbg==" target=\"_blank\">this</a> step-by-step tutorial written by the guys of Synology. Installing Subversion was/is very easy because there is an IPKG package available which will download and configure all dependencies for you. If you don&#8217;t know how to install IPKG, just read this <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy52b2xrb21lbmp1aXN0Lm5sL2Jsb2cvMjAwOS8wMy8wOS9pbnN0YWxsLWlwa2ctb24tc3lub2xvZ3ktZHMyMDkv" target=\"_blank\">blog</a>.</p>
<p>To understand a bit more of how Subversion exactly works, visit <a href="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3N2bmJvb2sucmVkLWJlYW4uY29tLw==" target=\"_blank\">this</a> website, where you can download a free e-book in a lot of different formats (like pdf / HTML).</p>
 <img src="http://www.volkomenjuist.nl/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=204" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.volkomenjuist.nl/blog/2009/03/11/subversion-on-synology-ds209/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

