<?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>Dariusz on Software Quality &#187; svn</title>
	<atom:link href="http://blog.aplikacja.info/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.aplikacja.info</link>
	<description>Software Engineering Process and Tools</description>
	<lastBuildDate>Tue, 31 Jan 2012 23:44:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Software Releases Using GIT</title>
		<link>http://blog.aplikacja.info/2010/11/software-releases-using-git/</link>
		<comments>http://blog.aplikacja.info/2010/11/software-releases-using-git/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 22:31:05 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=1376</guid>
		<description><![CDATA[Releasing Software is not just packing latest version to tarball and send to SFTP server. It requires preparation and some planning to be done properly. I&#8217;ll describe release procedure I applied on one of my latest projects. Supporting version control system is GIT.
The aims for releasing procedure designed:

allow for testing window before release date
have the [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://blog.aplikacja.info/wp-content/uploads/2010/11/floppy-disk.jpg"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-1377" title="floppy-disk" src="http://blog.aplikacja.info/wp-content/uploads/2010/11/floppy-disk.jpg" alt="" width="250" height="225" align="right"/></a>Releasing Software is not just packing latest version</strong> to tarball and send to SFTP server. It requires preparation and some planning to be done properly. I&#8217;ll describe release procedure I applied on one of my latest projects. Supporting version control system is <a href="http://git-scm.com/">GIT</a>.</p>
<p>The aims for releasing procedure designed:</p>
<ul>
<li>allow for <strong>testing window</strong> before release date</li>
<li>have the possibility for <strong>examine released version</strong> to test for reported bugs</li>
<li>possibility to manage existing releases (<strong>hot-fixing</strong> critical bugs)</li>
</ul>
<p><span id="more-1376"></span></p>
<h2>Prepare Release Candidate Branch</h2>
<p><a href="http://blog.aplikacja.info/wp-content/uploads/2010/11/branch.jpg"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-1382" title="branch" src="http://blog.aplikacja.info/wp-content/uploads/2010/11/branch.jpg" alt="" width="200" height="143"  align="right"/></a>We want to stabilize and test some snapshot of current development branch. That&#8217;s why I&#8217;m <strong>forking few days before release RC branch</strong> from &#8220;master&#8221; and switch (it will be used for hot-fixing):</p>
<pre style="padding-left: 30px;">git branch RELEASE_0.2.1_branch
git push origin RELEASE_0.2.1_branch
git co RELEASE_0.2.1_branch
</pre>
<p>I&#8217;m marking RC state (RC=Release Candidate) to be able to see changes done for released version:</p>
<pre style="padding-left: 30px;">git tag RELEASE_0.2.1_RC
git push --tags</pre>
<p>Anyone familiar with advanced CVS usage will see similarities to <a href="http://kb.wisc.edu/middleware/page.php?id=4087">tagging for CVS merge purposes</a>. GIT tracks merges automatically, however marking branch starting point is a good idea.</p>
<p>As you can see I created simple naming convention schema to manage releases.</p>
<h2>Prepare Release</h2>
<p>Time after creating RC branch and before releasing from this branch is the <strong>time for testers to do their job</strong> and sweep out as many defects as possible. Fixes are added directly on release branch (we will port them to master later).</p>
<p>When tests are done we are preparing release and tag current version by RELEASE_0.2.1</p>
<pre style="padding-left: 30px;">git commit -a -m "version number changed (#XYZ)"
git tag RELEASE_0.2.1
git push --tags</pre>
<p>By this tag we will be able to inspect exact version that was sent to our clients.</p>
<h2>Prepare hotfix</h2>
<p>Sometimes out safety net composed of automated test suite and testing team fails and we have to fix errors reported from production. That is the purpose for release candidate branch. First, switch to correct branch that supports hot-fixed release:</p>
<pre style="padding-left: 30px;">git branch --track RELEASE_0.2.1_branch origin/RELEASE_0.2.1_branch
==OR==: git co RELEASE_0.2.1_branch; git pull origin
</pre>
<p>Tag current version that goes in this hotfix by RELEASE_0.2.1_hotfix_YYYYMMDD:</p>
<pre style="padding-left: 30px;">git commit -a -m "version number changed (#XYZ)"
git tag RELEASE_0.2.1_hotfix_YYYYMMDD
git push --tags</pre>
<p>As you might noticed naming convention is based on branch name. Thanks to this convention we can answer the following questions:</p>
<ul>
<li>what hot-fixes were prepared for release X?</li>
<li>what is the latest hotfix for release X?</li>
<li>what was delivered in latest hotifix of release X?</li>
<li>etc.</li>
</ul>
<h2>Porting back changes from branch to master</h2>
<p>Sometimes changes made on branch will be useful for next releases. You can easily merge them back to master:</p>
<pre style="padding-left: 30px;">$ git co master
$ git merge RELEASE_0.2.1
$ git push
</pre>
<p>GIT tracks what have been merged already so you can merge/cherry-pick in both directions.</p>
<h2>Typical Usage</h2>
<p>What changes were included in latest hotfix compared to previous one:</p>
<pre style="padding-left: 30px;"> $ git diff RELEASE_0.2.1_hotfix_date1 RELEASE_0.2.1_hotfix_date2</pre>
<p>What changes were added in new release:</p>
<pre style="padding-left: 30px;">$ git log  RELEASE_0.2..RELEASE_0.2.1
$ git diff RELEASE_0.2..RELEASE_0.2.1</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2010/11/software-releases-using-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion: How To Revert Single Commit</title>
		<link>http://blog.aplikacja.info/2010/06/subversion-how-to-revert-single-commit/</link>
		<comments>http://blog.aplikacja.info/2010/06/subversion-how-to-revert-single-commit/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 12:35:18 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=1187</guid>
		<description><![CDATA[Let&#8217;s say you tracked someone broke HEAD of trunk and you want to reverse that single commit from main branch. Subversion makes very handy syntax for reverse merges:
svn merge -c -19203 https://REPO_URL
In example above you do reverse merge of 19203 revision (note &#8220;-&#8221; sign before revision number). After that merge:

Inspect if workspace compiles without errors
If [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you tracked someone broke HEAD of trunk and you want to <strong>reverse that single commit</strong> from main branch. Subversion makes very handy syntax for reverse merges:</p>
<pre style="padding-left: 30px;">svn merge -c -19203 https://REPO_URL</pre>
<p>In example above you do <strong>reverse merge</strong> of 19203 revision (note &#8220;-&#8221; sign before revision number). After that merge:</p>
<ul>
<li>Inspect if workspace compiles without errors</li>
<li>If it&#8217;s OK: commit local changeset</li>
<li>Notify 19203 committer about the change</li>
</ul>
<p><a href="http://blog.aplikacja.info/wp-content/uploads/2010/06/subversion.png"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter size-full wp-image-1191" title="subversion" src="http://blog.aplikacja.info/wp-content/uploads/2010/06/subversion.png" alt="" width="468" height="64" /></a></p>
<p>In order to <strong>fix broken commit</strong> original author should do the opposite:</p>
<pre style="padding-left: 30px;">svn merge -c 19203 https://REPO_URL
</pre>
<p>(note there&#8217;s no &#8220;-&#8221; before revision number). Then:</p>
<ul>
<li>Correct changeset and test if workspace is not broken</li>
<li>If it&#8217;s OK: commit local changeset (it will be nice to show original revision number in a comment)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2010/06/subversion-how-to-revert-single-commit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why svn:mime-type does matter?</title>
		<link>http://blog.aplikacja.info/2010/04/why-svnmime-type-does-matter/</link>
		<comments>http://blog.aplikacja.info/2010/04/why-svnmime-type-does-matter/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 11:36:57 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=1007</guid>
		<description><![CDATA[You probably already know that Subversion stores some kind of metadata for all files added to repository. It&#8217;s called &#8220;properties&#8221; in Subversion vocabulary. This key-value map is responsible for registering ingored files masks, file attributes, internal file content type etc.
The property I&#8217;m going to present today is &#8220;mime-type&#8220;. It describes file content in similar way [...]]]></description>
			<content:encoded><![CDATA[<p>You probably already know that Subversion stores some kind of <strong>metadata</strong> for all files added to repository. It&#8217;s called &#8220;<a href="http://svnbook.red-bean.com/en/1.5/svn.ref.properties.html">properties</a>&#8221; in Subversion vocabulary. This key-value map is responsible for registering ingored files masks, file attributes, internal file content type etc.</p>
<p>The property I&#8217;m going to present today is &#8220;<strong>mime-type</strong>&#8220;. It describes file content in similar way to HTTP header &#8220;Content-type&#8221; telling svn client how to handle the file. Typical values are: &#8220;text/plain&#8221;, &#8220;application/octet-stream&#8221;. Especially first part of mime-type is important:</p>
<ul>
<li>text/*: line-by-line merges are used, diffs are generated</li>
<li>any other prefix: no text merges prepared</li>
</ul>
<p>If you do not <strong>set this properly right</strong> you may end up with messed binary file (end-of-line conversions) or non-mergable changes in text file (that is marked as binary by mistake).</p>
<p>Of course during adding a file to workspace <strong>one can forget to set those properties correctly</strong>. Here auto-props comes with help. Auto-props are applied when &#8220;svn add&#8221; command (from command line or from GUI) is issued. Configuration is placed inside &#8220;~/.subversion/config&#8221; file. Here&#8217;s my config fragment from one of projects.</p>
<pre style="padding-left: 30px;">[auto-props]
*.csv = svn:mime-type=text/plain
*.java = svn:mime-type=text/plain
*.sql = svn:mime-type=text/plain
*.sql = svn:keywords=Author Date Id Revision URL
*.jar = svn:mime-type=application/octet-stream</pre>
<p>Besides mime-type svn:keywords is being set in the example. It controls which keywords are expanded in source files.</p>
<p style="text-align: center;"><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter" src="http://subversion.tigris.org/images/subversion_logo_hor-468x64.png" alt="" width="468" height="64" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2010/04/why-svnmime-type-does-matter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Do not reformat whole files on commit, PLEASE!</title>
		<link>http://blog.aplikacja.info/2010/02/do-not-reformat-whole-files-on-commit-please/</link>
		<comments>http://blog.aplikacja.info/2010/02/do-not-reformat-whole-files-on-commit-please/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 22:22:32 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=865</guid>
		<description><![CDATA[What&#8217;s the purpose of internal project documentation? To help people do their jobs. Developers need the knowledge to be distributed across the team, testers need definition of proper system behaviour, marketing needs information on product features to sell it.
Questions
Important knowledge that may be required by developers doing updates may be summarized in few sentences:

Who changed [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.aplikacja.info/wp-content/uploads/2010/02/paper.jpg"><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="size-full wp-image-868 alignright" title="paper" src="http://blog.aplikacja.info/wp-content/uploads/2010/02/paper.jpg" alt="" width="300" height="224" /></a>What&#8217;s the <strong>purpose of internal project documentation</strong>? To help people do their jobs. Developers need the knowledge to be distributed across the team, testers need definition of proper system behaviour, marketing needs information on product features to sell it.</p>
<h2>Questions</h2>
<p>Important knowledge that may be <strong>required by developers</strong> doing updates may be summarized in few sentences:</p>
<ul>
<li><strong>Who</strong> changed recently that line of code?</li>
<li><strong>When</strong> this method have been changed?</li>
<li><strong>Why</strong> algorithm works that way?</li>
</ul>
<p>There&#8217;s simple method of <strong>automatically saving and retrieving</strong> this kind of information: Subversion (or any other version control system). How?</p>
<p><span id="more-865"></span></p>
<h2>Answers</h2>
<p>There&#8217;s nice feature of version control system that is not the most frequent used but is very useful: <strong>annotation/blame</strong>. This special view shows you for a file:</p>
<ul>
<li><strong>Who</strong> changed this line?</li>
<li><strong>When</strong> this line was changed?</li>
<li>Revision number of commit =&gt; Log entry =&gt; Bug tracker task ID =&gt; rationale (<strong>Why</strong>)</li>
</ul>
<p>After locating such information you may have better understanding of source code.</p>
<p>How to check annotation using different tools:</p>
<ul>
<li>svn annotate filename</li>
<li>git annotate filename</li>
<li>bzr annotate filename</li>
<li>Eclipse: Team / Show Annotation</li>
</ul>
<h2>The problem</h2>
<p>Looks simple, but there&#8217;s a &#8220;quirk&#8221; here. If you are doing massive code changes (to enforce n+1th coding standard) you are <strong>overwriting original source code authors and information</strong>. Thus annotation (and log) becomes useless.</p>
<p>That&#8217;s why I&#8217;m asking you:</p>
<p style="text-align: center;"><strong>Do not reformat whole files on commit, PLEASE!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2010/02/do-not-reformat-whole-files-on-commit-please/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peer code reviews with Subversion</title>
		<link>http://blog.aplikacja.info/2010/02/peer-code-reviews-with-subversion/</link>
		<comments>http://blog.aplikacja.info/2010/02/peer-code-reviews-with-subversion/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 22:33:06 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=741</guid>
		<description><![CDATA[Aplikacja.info believes in continuous integration and frequent reases, so uses so-called stable trunk policy. That means: at any time any developer can make installation from trunk to production systems. How stable trunk can be achieved?

any commit done to trunk is protected by set of     automated tests that should run 100% clean [...]]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-744" title="13" src="http://blog.aplikacja.info/wp-content/uploads/2010/02/13.png" alt="13" width="227" height="290" /><a href="http://aplikacja.info/">Aplikacja.info</a> believes in continuous integration and frequent reases, so uses so-called <strong>stable trunk</strong> policy. That means: at any time any developer can make installation from trunk to production systems. How stable trunk can be achieved?</p>
<ul>
<li>any commit done to trunk is protected by set of     <strong>automated tests</strong> that should run 100% clean     (more critical project will use     framework for a continuous build process     like <a href="http://aplikacja.info/en/view.php?page=Developer+Guide">Cruise Control</a> or <a href="http://bazaar-vcs.org/PatchQueueManager">PQM</a>).</li>
<li>&#8220;risky&#8221; tasks are done using     peer code review process based on version control software</li>
</ul>
<h2>What to review?</h2>
<p>We believe the most efficient method of reviewing code is to look at <strong>changesets</strong> (unified diffs). Then reviewer can see exact changes done by another developer to meet task criteria and codebase to review is minimized to really important parts of code (changes with some lines of context). That&#8217;s why we believe <a href="http://blog.aplikacja.info/2009/12/subversion-best-practices/">forming proper changesets</a> is very important requirement.</p>
<h2>Commit methods</h2>
<p>There are mainly three methods of inserting new commits into trunk (specified in our implementation by special <strong>&#8220;target&#8221; field in bug tracker</strong>):</p>
<p><span id="more-741"></span></p>
<ul>
<li><strong>Direct commit</strong> (target=master) without code review: used mainly for simplest functionality without much risk involved. Minimal administration burden, minimal merge conflict.</li>
<li><strong>Patch Based Review</strong> (target=patch) using <a href="http://pmsvcs.sourceforge.net/">PMS</a> functionality for one-way code review: in this scenario only one developer is supposed to modify patch, another one is only reviewing. At least two developers are involved, merge conflict minimized by basing on trunk (patch is always re-based on trunk during development).</li>
<li><strong>Shared branch</strong> (target=branch) using VCS: Development is branched on separate branch and reviewved on this branch. Many developers can commit on this branch/review before merge. There is higher merge conflict risk for long development on branch.</li>
</ul>
<p>A convention used by us: patch / branch name should contain noun from task summary and task id separated by a dash:</p>
<pre>noun-task_id</pre>
<p>for example: <em>invoice-2351</em>. This way we can easily find topic branches and <strong>precisely point to taks specification</strong> (by a task id).</p>
<h2>Peer Code Review</h2>
<p>Where&#8217;s peer code review here? Three modes of commit, three review configurations follows:</p>
<ul>
<li>Direct commit: changeset is <strong>reviewed after commit</strong> on trunk (as I said lower risk encourages us to be flexible)</li>
<li>Patch-based (read-only) changeset view: <strong>patch is sent</strong> to another team member for review by email or shared patches repository</li>
<li>Classical &#8220;topic branch&#8221;: read/write review: team member <strong>switches to topic branch</strong> and checks latest commits, he may also place comments in source code</li>
</ul>
<h2>Old, Good TODOs</h2>
<p>What is <strong>a result of code review</strong>? The most efficient way to track problems found is to insert comments inside source code (in comments, near problematic code location). We prepared a convention of well-known TODO tags in source code: <em>TODO:nick description</em>. &#8220;nick&#8221; is abbreviation of comment recipient, description should be short and valuable. Here&#8217;s the example:</p>
<pre>/*
TODO:DCI VAT report summary should show taxes grouped by rates,
not the case now
*/</pre>
<p>Recipient then <strong>scans all source code</strong> for such TODOs and fix problems found (thus removes TODO in the same commit). This way:</p>
<ul>
<li>we can <strong>connect</strong> problem report with problem fix in one changeset</li>
<li>we can <strong>track</strong> who entered comment and who fixed it (from SVN history)</li>
</ul>
<h2>Summary</h2>
<p>Code inspections were found to be very effective method of raising quality of software (<a href="http://domino.watson.ibm.com/tchjr/journalindex.nsf/0/0b0da213f326b51385256bfa00685d97?OpenDocument">the IBM story</a>). I believe informal implementation called <strong>peer review plays very well with other agile tools</strong> we are using for developing better software.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2010/02/peer-code-reviews-with-subversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is &#8220;commit freeze&#8221; really required for software development?</title>
		<link>http://blog.aplikacja.info/2010/02/is-commit-freeze-really-required-for-software-development/</link>
		<comments>http://blog.aplikacja.info/2010/02/is-commit-freeze-really-required-for-software-development/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 14:12:46 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=714</guid>
		<description><![CDATA[During software development (especially done in agile way) there are often time when working software release must be prepared for customer evaluation of internal testing. I found many software release managers use a feature called &#8220;commit freeze&#8220;: no one can commit to main branch of development (trunk/master) until release is packaged. I doubt if it [...]]]></description>
			<content:encoded><![CDATA[<p><img style=' float: right; padding: 4px; margin: 0 0 2px 7px;'  class="alignright size-full wp-image-724" title="1162385_yellow_icicles" src="http://blog.aplikacja.info/wp-content/uploads/2010/02/1162385_yellow_icicles.jpg" alt="1162385_yellow_icicles" width="300" height="224" />During software development (especially done in agile way) there are often time when working software release must be prepared for customer evaluation of internal testing. I found many software release managers use a feature called &#8220;<strong>commit freeze</strong>&#8220;: no one can commit to main branch of development (trunk/master) until release is packaged. I doubt if it is really required.</p>
<p>The possible reason for freezing commits:</p>
<ul>
<li>creating <a href="http://www.mail-archive.com/hibernate-dev@lists.jboss.org/msg04037.html">releases from trunk</a></li>
<li>creating <a href="http://mail-archives.apache.org/mod_mbox/hadoop-hbase-dev/201001.mbox/%3C31a243e71001161015q2752404fme1d0aff7b08b1f8b@mail.gmail.com%3E">releases from branch</a></li>
<li>commit freeze <a href="http://marc.info/?l=phpdoc&amp;m=119722997021322&amp;w=2">during merge</a> from different branch</li>
<li>move to <a href="http://marc.info/?l=php-qa&amp;m=124695424521785&amp;w=2">different</a> version control system</li>
<li><a href="http://old.nabble.com/DocBook-5-upgrade---commit-freeze!-tc11205209.html">massive changes</a> expected that may cause many conflicts</li>
</ul>
<h2><span id="more-714"></span>Creating releases</h2>
<p>If you want to make minor changes related to release and block any other (probably more risky) changes to be accidentially introduced you needn&#8217;t freeze commits. The more efficient solution here is to <strong>fork a branch</strong>. On separate branch you can do any justification you need to build the binaries for release.</p>
<h2>Merging</h2>
<p>For time-consuming merges (especially when many conflicts are present) it&#8217;s tempting to prevent commits on target branch to minimize problems related to local development during merged changes commit. I think merging person should perform <strong>frequent updates insted</strong> from current branch and match merged changes to current trunk state.</p>
<h2>Switch version control software / repositories</h2>
<p>Switching between version control system is a big change in development team. One has to learn new toolset to operate efficiently with new version control system. Postponing commits on old repository is not required. Those changes <strong>could be reapplied later by creating patch</strong> from missing changesets and applying them on new repository. <a href="http://en.wikipedia.org/wiki/Diff">Path format</a> is a standard that allow to move changesets beteen different repositories.</p>
<h2>Summary</h2>
<p>In my opinion temporary blocking commits (so called &#8220;commit freeze&#8221;) is <strong>not a good idea</strong>. Agile methodology (the one we use at Aplikacja.info) requires frequent information sharing. There are alternatives that have lower impact on development and not get in the way for normal code flow.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2010/02/is-commit-freeze-really-required-for-software-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to correct comment after commit in Subversion</title>
		<link>http://blog.aplikacja.info/2009/12/how-to-correct-comment-after-commit-in-subversion/</link>
		<comments>http://blog.aplikacja.info/2009/12/how-to-correct-comment-after-commit-in-subversion/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 14:09:05 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=582</guid>
		<description><![CDATA[Correcting comments of existing commits is easy if you have enough privileges on subversion repository:
svn propedit -r &#60;revision-number-here&#62; --revprop svn:log "&#60;new log message&#62;" &#60;url&#62;
That&#8217;s all. Pretty simple.
http://subversion.tigris.org/faq.html#change-log-msg
]]></description>
			<content:encoded><![CDATA[<p><a href="http://subversion.tigris.org/faq.html#change-log-msg">Correcting comments of existing commits</a> is easy if you have enough privileges on subversion repository:</p>
<pre style="padding-left: 30px;">svn propedit -r &lt;revision-number-here&gt; --revprop svn:log "&lt;new log message&gt;" &lt;url&gt;</pre>
<p>That&#8217;s all. Pretty simple.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">http://subversion.tigris.org/faq.html#change-log-msg</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2009/12/how-to-correct-comment-after-commit-in-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Best Practices</title>
		<link>http://blog.aplikacja.info/2009/12/subversion-best-practices/</link>
		<comments>http://blog.aplikacja.info/2009/12/subversion-best-practices/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 21:15:55 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=539</guid>
		<description><![CDATA[I&#8217;ve been using many version control systems in software development projects. I&#8217;m aware Subversion is not the best version control system out there, but it&#8217;s most popular (at least among enterprise projects I&#8217;ve been working on).
I&#8217;m describing here Subversion usage best practices that come from my experience with Subversion (or other version control systems) collected [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using many version control systems in software development projects. I&#8217;m aware Subversion is not the best version control system out there, but it&#8217;s <strong>most popular</strong> (at least among enterprise projects I&#8217;ve been working on).</p>
<p>I&#8217;m describing here <strong>Subversion usage best practices</strong> that come from my experience with Subversion (or other version control systems) collected on many projects. Some suggestions are related strictly to Subversion, some are general.</p>
<h2><span id="more-539"></span>Commit complete, logical changesets</h2>
<p>Always commit <strong>complete</strong> patch. &#8220;Complete&#8221; means the commit:</p>
<ul>
<li>shouldn&#8217;t have <strong>compilation errors</strong></li>
<li>shouldn&#8217;t lower successful <strong>test cases</strong> counter</li>
<li>should have precise <strong>purpose</strong> (one fixed bug, implemented feature, as so on&#8230;)</li>
</ul>
<p>Why complete changesets are <strong>so important</strong>? You can easily then:</p>
<ul>
<li><strong>reapply</strong> only selected bugfixes on another branch (sometimes it&#8217;s called cherry-picking)</li>
<li><strong>undo change</strong> that made system unstable by simple reverted merge</li>
</ul>
<p>Sometimes you have <strong>many different changes</strong> (example: two bugfixes, one feature added) in your workspace and it seems the easiest way is to commit them in one big commit. DON&#8217;T. You can use &#8220;svn diff&#8221;, &#8220;patch&#8221; commands to split your local changeset into few parts and commit them separately. How? It&#8217;s simple (but not obvious at first glance):</p>
<ol>
<li>svn diff &gt; ../changeset.diff</li>
<li>$EDITOR ../changeset.diff</li>
<li>Leave only <strong>changes to be removed</strong> from working copy, delete remaining changes</li>
<li>patch -p0 -R &lt;  ../changeset.diff</li>
<li>Now you have yor workspace without changes to be removed, retest, commit</li>
<li>patch -p0 &lt;  ../changeset.diff</li>
<li>Now you have only <strong>changed that previously were skipped</strong>, retest, commit</li>
</ol>
<p>Special tool have been implemented that can automate above flow: <a href="http://code.google.com/p/pmsvcs/">PMS</a> (Patch Management System).</p>
<h2>Do not commit workspace partially</h2>
<p>If you commit only subset of files from your working copy you <strong>risk breaking the build</strong>. The proper way for splitting working copy into separate commits is to reverse patch your changeset (see previous practice examples).</p>
<p>Similar problem appears when you <strong>forget to add to versioned files</strong> new file (and it appears as &#8220;?&#8221; on &#8220;svn status&#8221; listing). Use &#8220;svn status&#8221; frequently and properly set svn:ignored where necessary.</p>
<h2>Continuous integration simplified: commit often, update very often</h2>
<p>If you postpone your changes more that two days it&#8217;s very likely someone will use obsolete API that you&#8217;re refactoring and someone will get compilation errors. Try to make <strong>atomic but small commit</strong> to minimize such risk.</p>
<p>When you develop a feature it&#8217;s very likely you will use obsolete API that some other developer is refactoring now. <strong>Update very often</strong> to see fresh system state.</p>
<p>Have you noticed above paragraphs are very similar? You have to <strong>make fast information flow</strong>. Making long-living branches will postpone new code from being integrated. Frequent merges and commits are implementation of continuous integration. Every integration problem (as API change mentioned in this section) will be visible as soon as possible (when it is stable enough to be committed).</p>
<p>Someone can point out that frequent commits can destroy trunk stability &#8211; see next section for answer.</p>
<h2>Shared branches must be stable, Really</h2>
<p>When you are working on isolated topic branch you don&#8217;t need to ensure it&#8217;s stable enough to be committed. It&#8217;s not needed to compiler, either. But if anyone will have access with you to this branch/trunk you must ensure it will remain stable. <strong>Stable branch encourage frequent updates</strong> and it&#8217;s base to Continuous integration.</p>
<p>How can we define <strong>&#8220;stable&#8221; criteria</strong> for local changeset to be committed:</p>
<ul>
<li>Code compiles with <strong>no errors</strong></li>
<li>No additional failing tests (<strong>no regression</strong>!)</li>
<li>Ensure <strong>no accidental whole-file reformatting</strong> by viewing diffs (svn di)</li>
<li>Ensure <strong>no forgotten unversioned files</strong> (svn status = ?) in your repository (it may break compilation for someone else)</li>
</ul>
<h2>Use meaningful commit comments</h2>
<p>A typical error (yes, error) made by novice programmers is <strong>empty or &#8220;asdf&#8221;-style commit comments</strong>. The information what was committed is hidden in commit changeset only. It will make code inspection harder. I suggest to enter at least in commit comment:</p>
<ul>
<li>Issue tracker ID if preset (to link commit to issue fixed)</li>
<li>short one-line description (can be copied from issue tracker)</li>
</ul>
<p>Then anyone can look at fresh commits:</p>
<p style="padding-left: 30px;">svn log -l 10</p>
<p>and see what&#8217;s going on now in the project.</p>
<h2>Care about merge and annotate &#8211; DO NOT reformat whole file</h2>
<p>Sometimes when I want to trace who are responsible for particular change in file I&#8217;m discovering by <strong>annotate</strong> that whole file have been changed recently by one person. Why? This programmer reformatted whole file and committed big changeset. Now file looks better but at what price? Original committer information is <strong>lost</strong>.</p>
<p>Similar problem occurs when you <strong>merge such changeset</strong> (from topic branch to trunk for instance). There are many conflicts because merge changeset overlap with changesets committed previously on trunk.</p>
<p>Subversion like many other popular version control systems <span style="text-decoration: line-through;"><strong>loses commit information</strong> on merge </span>(merged person is visible instead of original authors of merged changesets). If you expect to preserve such information <a href="http://git-scm.com/">use GIT</a>. (Thanks Michal to pointing this out: Subversion &gt;= 1.5 <a href="http://subversion.tigris.org/merge-tracking/requirements.html">tracks merges</a>).</p>
<h2>Setup auto properties correctly</h2>
<p>In mixed systems environment there are many formats of storing files. EOL (end of line) standards differs between operating systems. Subversion allows to convert-on-fly EOL style. In order to make use of such feature you have to set &#8220;<a href="http://svnbook.red-bean.com/en/1.2/svn.advanced.props.html#svn.advanced.props.special.mime-type">svn:mime-type: text/plain</a>&#8220;.</p>
<p>Setting such properties on every added files can be boring, so <a href="http://http://svnbook.red-bean.com/en/1.2/svn.advanced.props.html#svn.advanced.props.auto">auto properties</a> have been introduced in Subversion. You can map (locally) properties to extensions in your ~/.subversion/config:</p>
<pre>[auto-props]
*.csv = svn:mime-type=text/plain
*.java = svn:mime-type=text/plain
*.sql = svn:mime-type=text/plain</pre>
<h2>Setup svn:ignore in repository</h2>
<p>Some files are required to live in project directory but <strong>shouldn&#8217;t be committed</strong> into SVN (*.class, *.ear, &#8230;). General &#8220;ignore&#8221; mechanism marks such files (or file masks) to be invisible for SVN (not reported as unknown files &#8220;?&#8221;). Typically CVS used .cvsignore file, Bazaar reads .bzrignore, SVN reads svn:ignore property AND local user preferences stored in ~/.subversion/config.</p>
<p>Do not depend on local developer ignore settings in ~/.subversion/config. Attach <strong>svn:ignore tag to proper directories</strong> to be present on every working copy. It will make to add new filters easier (by commiting new properties once to Subversion).</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 305px; width: 1px; height: 1px;">
<h2>merge</h2>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2009/12/subversion-best-practices/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>svn: Malformed URL for repository</title>
		<link>http://blog.aplikacja.info/2009/12/svn-malformed-url-for-repository/</link>
		<comments>http://blog.aplikacja.info/2009/12/svn-malformed-url-for-repository/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 10:01:48 +0000</pubDate>
		<dc:creator>dariusz.cieslak</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://blog.aplikacja.info/?p=536</guid>
		<description><![CDATA[During a merge from branch on the same repository as current copy:
svn merge -r17007:17249 http://hostname/svn/path
I got the error: svn: Malformed URL for repository. The fix is to add user name in SVN URL:
svn merge -r17007:17249 http://dcieslak@hostname/svn/path
Is this a Subversion bug? Probably the problem is that my username placed in SVN config file has form: domainname\username. [...]]]></description>
			<content:encoded><![CDATA[<p>During a <strong>merge from branch</strong> on the same repository as current copy:</p>
<pre style="padding-left: 30px;">svn merge -r17007:17249 http://hostname/svn/path</pre>
<p>I got the error: <strong>svn: Malformed URL for repository</strong>. The <a href="http://groups.google.com/group/visualsvn/browse_thread/thread/81d604209e1b3ea5">fix</a> is to add user name in SVN URL:</p>
<pre style="padding-left: 30px;">svn merge -r17007:17249 http://dcieslak@hostname/svn/path</pre>
<p>Is this a <strong>Subversion bug</strong>? Probably the problem is that my username placed in SVN config file has form: domainname\username. Maybe SVN merge cannot handle that format?</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  class="aligncenter" src="http://subversion.tigris.org/images/subversion_logo_hor-468x64.png" alt="" width="468" height="64" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.aplikacja.info/2009/12/svn-malformed-url-for-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

