<?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>JohnMark.org Headquarters &#187; sparse directories</title>
	<atom:link href="http://www.johnmark.org/blog/tag/sparse-directories/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnmark.org/blog</link>
	<description>Just another John Mark production</description>
	<lastBuildDate>Sat, 24 Dec 2011 09:43:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Sparse Directories, Now With Exclusion</title>
		<link>http://www.johnmark.org/blog/2009/03/sparse-directories-now-with-exclusion/</link>
		<comments>http://www.johnmark.org/blog/2009/03/sparse-directories-now-with-exclusion/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 05:12:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Submerged]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[sparse directories]]></category>
		<category><![CDATA[Subversion Client]]></category>
		<category><![CDATA[svn1.5]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA["cmpilato ❤ sparse directories" If I had a dollar for every time I've typed that… well, you and I could at least spring for some Fazoli's fast-food Italian. Okay, I admit that the emotion doesn't always drive me to public expression, but that in no way diminishes my fondness for...]]></description>
			<content:encoded><![CDATA[<div xmlns="http://www.w3.org/1999/xhtml">
<p>&#8220;cmpilato ❤ sparse directories&#8221;</p>
<p>If I had a dollar for every time I&#8217;ve typed that&hellip; well, you and I could at least spring for some <a href="http://fazolis.com/">Fazoli&#8217;s</a> fast-food Italian.  Okay, I admit that the emotion doesn&#8217;t always drive me to public expression, but that in no way diminishes my fondness for this feature.</p>
<p>Introduced in Subversion 1.5, <a href="http://blogs.open.collab.net/svn/2007/06/sparse-director.html">sparse directory</a> support is one of a few features from that release (besides <a href="http://blogs.open.collab.net/svn/2008/05/subversion-15-1.html">merge tracking</a> and <a href="http://blogs.open.collab.net/svn/2008/03/do-not-post-mer.html">foreign repository merges</a>) that I&#8217;ve fully integrated into my day-to-day activities.  I dig organization.  I tend to keep a pretty neat home directory.  But I routinely work on <a href="http://subversion.tigris.org/">several</a> <a href="http://viewvc.tigris.org/">different</a> <a href="http://svnbook.org/">pieces</a> of <a href="http://thotkeeper.org">software</a>, and at any given time, I&#8217;m tracking several different development branches in each of those pieces of software.  Were I not using sparse directories, my &#8220;projects&#8221; directory would look something like this:</p>
<blockquote><pre>$ ls ~/projects
subversion/		      svnbook/		 viewvc-1.0.7/
subversion-1.5.x/	      thotkeeper/	 viewvc-1.0.x/
subversion-1.6.x/	      thotkeeper-0.3.0/  viewvc-1.1.0-beta1/
subversion-http-protocol-v2/  viewvc/		 viewvc-1.1.x/
$
</pre>
</blockquote>
<p>On the positive side of things, I could quickly update all my working copies by simply running <tt>svn update ~/projects/*</tt>.</p>
<p>But those of you who have <a href="http://en.wikipedia.org/wiki/Command_line_completion">command-line completion</a> as hard-wired into your habits as I do will immediately notice that so many common directory prefixes does a useless completion environment make.  And <span >not</span> using common prefixes?  Well that&#8217;s just barbaric.</p>
<p>Fortunately, sparse directories has given me a whole new perspective on working copy organization.  Now, my projects directory contains (gasp!) only projects, and looks like this:</p>
<blockquote><pre>$ ls ~/projects
subversion/  svnbook/  thotkeeper/  viewvc/
$
</pre>
</blockquote>
<p>Those directories are sparse checkouts of the root directories of their respective project repositories.  Beneath them are (at least) &#8220;trunk&#8221; directories, probably &#8220;branch&#8221; and some of its children, and maybe even &#8220;tags&#8221; with some of its children in certain cases.  <tt>svn up ~/projects/*</tt> still works, and my working copy topology matches that of the repositories.</p>
<p>I won&#8217;t go into the details of how sparse checkouts works here &mdash; I&#8217;ve already documented the Subversion 1.5 implementation of them in the second edition of <a href="http://svnbook.org/buy/"><span >Version Control With Subversion</span></a> (which you can read at http://svnbook.red-bean.com/en/1.5/svn.advanced.sparsedirs.html).  The point of this blog post is to tell you about how Subversion 1.6 improves this feature in a key way.</p>
<p>In Subversion 1.6 (slated for release Any Day Now), the <tt>--set-depth</tt> parameter to <tt>svn update</tt> has grown a new value &mdash; <tt>exclude</tt>.  This value tells Subversion to exclude the target from the working copy, immediately and until further notice.  Prior to Subversion 1.6, if a branch I was working on was no longer of interest to me, I couldn&#8217;t easily remove it from my working copy.  If I simply deleted it, it would return the next time I updated the working copy.  If I <tt>svn delete</tt>&#8216;d it, the branch remained as a local modification forever.  (Unless, of course, I accidentally committed it, which brought a whole different sort of trouble to my doorstep.  Angry peers.  Pitchforks and torches.  It was a mess &mdash; you don&#8217;t want to go there.)  The new exclusion mechanism in Subversion 1.6 is the Right Way To Do It.</p>
<p>Say I no longer care about what&#8217;s going on some directory of one my project working copies.  Maybe I don&#8217;t care about the Subversion project&#8217;s website any more.  Well, with this new exclusion feature, I can tell Subversion to remove that directory:</p>
<blockquote><pre>$ cd ~/projects/subversion/trunk
$ svn update --set-depth=exclude www
D         www
$ ls www
ls: cannot access www: No such file or directory
$
</pre>
</blockquote>
<p>Done deal.  When I update my working copy in the future, I will not receive any changes aimed at that <tt>www</tt> directory.  If I later decide that I once again care about that directory, I can &#8220;resubscribe&#8221; to it again:</p>
<blockquote><pre>$ svn update --set-depth=infinity www
A    www
A    www/links.html
A    www/testing-goals.html
&hellip;
A    www/tigris-permissions.html
A    www/webdav-usage.html
Updated to revision 36292.
$
</pre>
</blockquote>
<p>Note that if you exclude a versioned directory that has some unversioned files in it, or some files with local modifications, Subversion handles this situation gracefully.  All the files that aren&#8217;t safe to delete, Subversion leaves around, and of course leaves any intermediate directories required to reach those files, too.</p>
<p>I hope this enhancement serves you as well as it has served me.  What do you think?  How are you using sparse directories to better organize your life?</p>
</div>
<p><map name='google_ad_map_1488_bdfb6b8d2a9af00f'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1488?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1488_bdfb6b8d2a9af00f' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1488&amp;url= http%3A%2F%2Fwww.johnmark.org%2Fblog%2F2009%2F03%2Fsparse-directories-now-with-exclusion%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.johnmark.org/blog/2009/03/sparse-directories-now-with-exclusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

