<?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>#! &#187; Unison</title>
	<atom:link href="http://hash-bang.net/tag/unison/feed/" rel="self" type="application/rss+xml" />
	<link>http://hash-bang.net</link>
	<description>The start of all wonderful things</description>
	<lastBuildDate>Mon, 30 Apr 2012 00:28:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Interactive file merging with Unison</title>
		<link>http://hash-bang.net/2009/08/ia-merging-unison/</link>
		<comments>http://hash-bang.net/2009/08/ia-merging-unison/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 03:23:48 +0000</pubDate>
		<dc:creator>mc</dc:creator>
				<category><![CDATA[HowTo's]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Unison]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://hash-bang.net/?p=151</guid>
		<description><![CDATA[After trying in vein to find decent documentation on the Merge functionality of Unison I eventually gave in and invested an hour or two trying out different Linux based merge programs in order to find something Unison, the merge program and I were happy with. So onto the diff-merging candidates: VimDiff (part of Vim) Doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>After trying in vein to find decent documentation on the Merge functionality of <a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison</a> I eventually gave in and invested an hour or two trying out different Linux based merge programs in order to find something Unison, the merge program and I were happy with.</p>
<p>So onto the diff-merging candidates:</p>
<h2><a href="http://linux.about.com/library/cmd/blcmdl1_vimdiff.htm">VimDiff</a> (part of <a href="http://www.vim.org/">Vim</a>)</h2>
<p>Doesn&#8217;t work too well with Unison. I can&#8217;t get <a href="http://en.wikipedia.org/wiki/GNOME_Terminal">gnome-terminal</a> (my terminal of choice) to execute synchronously so I was forced to fall back on <a href="http://invisible-island.net/xterm/">XTerm</a> instead.</p>
<p>After using XTerm I immediately hit upon a problem: there is no sensible way of outputting the results of a merge in VimDiff. Which is a pity because I do prefer VIM as an editor but this lack of functionality is annoying (yes I could have used a wrapper script but I&#8217;m trying to keep this simple).</p>
<h2><a href="http://meld.sourceforge.net/">Meld</a></h2>
<p>Very pretty but lacks features such as &#8216;Use Left-hand-side-file for all changes&#8217; and some of the other filtering options provided by KDiff3.</p>
<p>Also, like, VimDiff, does not provide any sensible output mechanism of the eventually merged file.</p>
<h2><a href="http://kdiff3.sourceforge.net/">KDiff3</a></h2>
<p>Not as good looking as Meld but provides pretty much everything I want in a merge program including the all important merged file output that Unison requires.</p>
<p>Can get a little annoying though with its insentient pop-up boxes. I wish there were a &#8216;Dont show this option again&#8217; option to each. KDE is usually quite good with this so I&#8217;m not sure why KDiff3 managed to escape this unspoken standard.</p>
<h2>Conclusion</h2>
<p>So how to use KDiff3 with Unison? First install kdiff3:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p151code3'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1513"><td class="code" id="p151code3"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> kidff3</pre></td></tr></table></div>

<p>Then open your Unison profiles .prf file and insert the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p151code4'); return false;">View Code</a> INI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1514"><td class="code" id="p151code4"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">merge</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> Name * -&gt; kdiff3 CURRENT1 CURRENT2 -L1 'Local File' -L2 'Remote File' -o NEW -m</span>
<span style="color: #000099;">confirmmerge</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> true</span></pre></td></tr></table></div>

<p>If you are comfortable with KDiff3 you could remove the &#8216;confirmmerge&#8217; line which forces Unison to double check you actually want to accept the changes.</p>
<p>The downside to the above interactive merging process is there is no sensible way to preview the merge in Unison (the &#8216;View Merge&#8217; button in the confirmation dialogue). For now though its preferable to not having this functionality at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://hash-bang.net/2009/08/ia-merging-unison/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

