<?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>Excursus &#187; fmdiff</title>
	<atom:link href="http://markelikalderon.com/category/diff/fmdiff/feed/" rel="self" type="application/rss+xml" />
	<link>http://markelikalderon.com</link>
	<description>Philosophy and Text</description>
	<lastBuildDate>Tue, 27 Dec 2011 23:01:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Subversion and TextMate</title>
		<link>http://markelikalderon.com/2007/05/11/subversion-and-textmate/</link>
		<comments>http://markelikalderon.com/2007/05/11/subversion-and-textmate/#comments</comments>
		<pubDate>Fri, 11 May 2007 22:09:11 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[FileMerge]]></category>
		<category><![CDATA[Text]]></category>
		<category><![CDATA[Text Editor]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[fmdiff]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2007/05/11/subversion-and-textmate/</guid>
		<description><![CDATA[Another post in my series on subversion, a free, open source version control system: Subversion Subversion, Serendipity, and Discipline Subversion and the Single User LaTeX and Subversion Circle Six Subversion Subverting Difference Today we&#8217;ll look at three ways that subversion interacts with my favorite text editor, TextMate: TextMate&#8217;s subversion repository TextMate&#8217;s subversion integration Keeping local [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://markelikalderon.com/wp-content/uploads/2007/05/subversion_logo_hor-468x64.png' alt='subversion' /></p>

<p><img src='http://markelikalderon.com/wp-content/uploads/2007/05/textmate.jpg' alt='TextMate' /></p>

<p>Another post in my series on <a href="http://subversion.tigris.org/" title="subversion.tigris.org">subversion</a>, a free, open source version control system:</p>

<ul>
<li><a href="http://markelikalderon.com/blog/2007/03/29/subversion/">Subversion</a></li>
<li><a href="http://markelikalderon.com/blog/2007/03/30/subversion-serendipity-and-discipline/">Subversion, Serendipity, and Discipline</a></li>
<li><a href="http://markelikalderon.com/blog/2007/04/14/subversion-and-the-single-user/">Subversion and the Single User</a></li>
<li><a href="http://markelikalderon.com/blog/2007/04/14/latex-and-subversion/">LaTeX and Subversion</a></li>
<li><a href="http://markelikalderon.com/blog/2007/04/18/circle-six-subversion/">Circle Six Subversion</a></li>
<li><a href="http://markelikalderon.com/blog/2007/04/28/subverting-difference/">Subverting Difference</a></li>
</ul>

<p>Today we&#8217;ll look at three ways that subversion interacts with my favorite text editor, <a href="http://macromates.com/" title="TextMate — The Missing Editor for Mac OS X">TextMate</a>:</p>

<ol>
<li><a href="#repository">TextMate&#8217;s subversion repository</a></li>
<li><a href="#integration">TextMate&#8217;s subversion integration</a></li>
<li><a href="#sync">Keeping local modifications to TextMate in sync across multiple computers with subversion</a></li>
</ol>

<h1 id="repository">TextMate&#8217;s Subversion Repository</h1>

<p>In Prefences &#x2192; Software Update you can set TextMate to automatically check for updates (recommended). You can also set it to watch for <em>cutting edge</em> updates. Cutting edge updates add advanced functionality and some bundles require this setting. In a way, the label is misleading, since the cutting edge updates tend to be very stable. If, however, you want the <em>bleeding edge</em> of TextMate development, you will have to access TextMate&#8217;s subversion repository, <a href="http://macromates.com/svn/Bundles/trunk/">http://macromates.com/svn/Bundles/trunk/</a>. There you will find bundles, plugins, support files, themes, tools, and more. Instructions about how to checkout bundles from the subversion repository can be found in the <a href="http://macromates.com/textmate/manual/bundles">manual</a> (RTFM, baby), and the <a href="http://macromates.com/wiki/Main/SubversionCheckout">wiki</a>. These should definitely be read. But above all check out <a href="http://skiadas.dcostanet.net/afterthought/">Haris Skiadas</a>&#8217; excellent <a href="http://skiadas.dcostanet.net/afterthought/2006/12/20/subversion-and-textmate/">tutorial</a>.</p>

<h1 id="integration">TextMate&#8217;s Subversion Integration</h1>

<p>TextMate, like other advanced editors on OS X such as <a href="http://www.barebones.com/" title="Welcome to Bare Bones Software">BBEdit</a> and <a href="http://aquamacs.org/" title="Aquamacs: Emacs for Mac OS X">Aquamacs</a>, enjoys subversion integration. So instead of working with subversion from the command line or with a subversion front end like <a href="http://www.lachoseinteractive.net/en/community/subversion/svnx/" title="La Chose : web agency and software maker – agence web et développement de logiciels">svnX</a>, it is possible to work with subversion directly from your text editor. &#x2303; &#x21E7; A brings up a menu with common subversion commands. If you have opened your working copy as a TextMate project, then selecting the root of that directory and selecting `status&#8217; will bring up an HTML window with the output of the command:</p>

<pre><code>svn status
</code></pre>

<p>Click on the thumbnail below for a picture.</p>

<p><a href='http://markelikalderon.com/wp-content/uploads/2007/05/status.jpg' title='svn status'><img src='http://markelikalderon.com/wp-content/uploads/2007/05/status.thumbnail.jpg' alt='svn status' /></a></p>

<p>As you can see, the HTML window not only shows the relevant files and their status, but it allows you to perform certain actions&#8212;you can add, revert, diff, and commit. The diff command displays line differences&#8212;not great for prose, as I have emphasized <a href="http://markelikalderon.com/blog/2007/02/15/diff-programs-diffed/">here</a> and <a href="http://markelikalderon.com/blog/2007/04/28/subverting-difference/">here</a>. Fortunately, selecting commit brings up the following dialogue window:</p>

<p><a href='http://markelikalderon.com/wp-content/uploads/2007/05/commit.jpg' title='svn commit'><img src='http://markelikalderon.com/wp-content/uploads/2007/05/commit.thumbnail.jpg' alt='svn commit' /></a></p>

<p>Notice that you can diff from here as well. However, this will use whatever diff program you have assigned as the value of the shell variable</p>

<pre><code>TM_SVN_DIFF_CMD 
</code></pre>

<p>in Preferences &#x2192; Advanced &#x2192; Shell Variables. Setting the value of this variable to <a href="http://ssel.vub.ac.be/ssel/internal:fmdiff">fmdiff</a> will allow you to display word differences graphically in <a href="http://en.wikipedia.org/wiki/Apple_FileMerge#FileMerge">FileMerge</a>.</p>

<h1 id="sync">Keeping TextMate in Sync</h1>

<p>One of the great things about TextMate is how easily configurable it is. Even if you are not a programmer, after a while you will find yourself writing snippets, commands, and maybe even entire bundles. Suppose, however, you work on more than one machine&#8212;say, at home and at work. It would be great if you could keep these local modifications in sync. (Frustration is an essential tab trigger that works on one but not another copy of TextMate.) Fortunately there is an easy solution. Just commit:</p>

<pre><code>~/Libray/Application Support/TextMate
</code></pre>

<p>and</p>

<pre><code>svn up
</code></pre>

<p>will keep you up to date on whatever machine you are on.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2007/05/11/subversion-and-textmate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Subverting Difference</title>
		<link>http://markelikalderon.com/2007/04/28/subverting-difference/</link>
		<comments>http://markelikalderon.com/2007/04/28/subverting-difference/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 18:20:22 +0000</pubDate>
		<dc:creator>Mark Eli Kalderon</dc:creator>
				<category><![CDATA[FileMerge]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[fmdiff]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn diff]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[wdiff]]></category>

		<guid isPermaLink="false">http://markelikalderon.com/blog/2007/04/28/subverting-difference/</guid>
		<description><![CDATA[Subversion allows you to compare the differences between revisions of a given document with the command: svn diff Let&#8217;s begin with the simplest and most common use of this command. But first a bit of terminology. Each time a change is committed to the repository its revision number increments. Revision keywords can be used instead [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://markelikalderon.com/wp-content/uploads/2007/04/fetchphp.gif' alt='FileMerge' /></p>

<p><a href="http://subversion.tigris.org/" title="subversion.tigris.org">Subversion</a> allows you to compare the differences between revisions of a given document with the command:</p>

<pre><code>svn diff
</code></pre>

<p>Let&#8217;s begin with the simplest and most common use of this command. But first a bit of terminology. Each time a change is committed to the repository its <em>revision number</em> increments. <em>Revision keywords</em> can be used instead of revision numbers. <em>BASE</em> is a revision keyword and refers to the pristine copy of an item in a working copy. The pristine copy of a file is a copy of your file as it was the last time your working copy was updated. It resides in the .svn directory within your file&#8217;s directory. So if your file is foo and it resides in directory bar, then running:</p>

<pre><code>ls -a
</code></pre>

<p>in directory bar will reveal:</p>

<pre><code>.svn
foo
</code></pre>

<p>.svn is an administrative directory that subversion makes use of and you should never modify it. Other useful revision keywords are:</p>

<ul>
<li>HEAD&#8212;the latest revision in the repository</li>
<li>COMMITTED&#8212;the last revision in which the file changed before BASE</li>
<li>PREV&#8212;the revision that precedes the last revision in which the file changed before BASE, that is, COMMITTED - 1.</li>
</ul>

<p>The command:</p>

<pre><code>svn diff foo
</code></pre>

<p>will compare the foo with BASE, that is, its pristine copy. So it will reveal the changes you have made to foo since you last updated your working copy. This is one of the more common uses of svn diff since it provides information necessary to write an informative commit message.</p>

<p>That&#8217;s pretty useful. But sometimes you may want to do something more. Fortunately, svn diff comes with a slew of options that allow for a fair amount of flexibility.</p>

<p>First, suppose you want to compare the modifications that you made to your file with an older revision, say, revision 17. The command:</p>

<pre><code>svn diff -r 17 foo
</code></pre>

<p>allows you to do just that. It compares foo as it was in revision 17 with foo as it presently is in your working copy.</p>

<p>Second, suppose you want to compare the differences between to older revisions, say revisions 17 and 23. The command:</p>

<pre><code>svn diff -r 17:23 http://url/of/your/repository/foo
</code></pre>

<p>will display these differences.</p>

<p>One really useful option is &#8211;diff-cmd. This option allows you to pass arguments to an external diff program. Why is this useful? Well svn diff only displays <em>line</em> differences. If you are writing prose in a text editor, paragraphs are long lines. What would be more useful is for <em>word</em> differences to be displayed. The option &#8211;diff-cmd allows you to use an external diff program that displays word differences.</p>

<p>I like to use Apple&#8217;s <a href="http://the.taoofmac.com/space/Applications/FileMerge" title="The Tao of Mac - Applications/FileMerge">FileMerge</a>, a graphical diff program that can be opened from the command line with:</p>

<pre><code>opendiff
</code></pre>

<p>Unfortunately, opendiff and svn diff use different arguments. So to get opendiff to work with subversion requires a shell script wrapper. Fortunately, <a href="http://ssel.vub.ac.be/ssel/internal:fmdiff">Bruno De Fraine</a> has done the heavy lifting. His script fmdiff is just such a wrapper. fmdiff can be downloaded (or checked out) form this <a href="http://ssel.vub.ac.be/svn-gen/bdefrain/fmscripts/">link</a>. If you install fmdiff in /usr/local/bin or ~/bin as is your preference and make it executable, you could then run the command:</p>

<pre><code>svn diff diff-cmd fmdiff foo
</code></pre>

<p>to reveal the differences between foo and its pristine copy in FileMerge.</p>

<p>Bear in mind, if you want to use an external diff program, say, <a href="http://www.gnu.org/software/wdiff/wdiff.html" title="wdiff - GNU Project - Free Software Foundation (FSF)">GNU wdiff</a>, you may very well need to write a wrapper script to accommodate a difference in arguments.</p>
]]></content:encoded>
			<wfw:commentRss>http://markelikalderon.com/2007/04/28/subverting-difference/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

