<?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>Sam Pierson&#039;s Blog &#187; subversion</title>
	<atom:link href="http://sampierson.com/blog/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://sampierson.com/blog</link>
	<description>Augmentation of an Imperfect Memory.</description>
	<lastBuildDate>Wed, 21 Jul 2010 01:41:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Subversion hackery</title>
		<link>http://sampierson.com/blog/software-development/subversion-hackery/</link>
		<comments>http://sampierson.com/blog/software-development/subversion-hackery/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 23:47:07 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=172</guid>
		<description><![CDATA[In preparation from some git experimentation, I just converted one subversion repository with a layout like this:
repo/
repo/example_dragdrop
repo/dedup
Into two separate repositories, each named after their respective project, containing a trunk/ folder with all the content.  Here is what I did:

svnadmin dump repo &#62; repo.dump

I had previously done a lot of moving crap around inside this [...]]]></description>
			<content:encoded><![CDATA[<p>In preparation from some git experimentation, I just converted one subversion repository with a layout like this:</p>
<pre>repo/
repo/example_dragdrop
repo/dedup</pre>
<p>Into two separate repositories, each named after their respective project, containing a trunk/ folder with all the content.  Here is what I did:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump repo <span style="color: #000000; font-weight: bold;">&gt;</span> repo.dump</pre></div></div>

<p>I had previously done a lot of moving crap around inside this repo that svndumpfilter objected to vehemently, so I edited repo.dump, found those revisions (look for lines starting ^Revision-number:) and deleted them.</p>
<p>Then I could use svndumpfilter to pull the separate projects out of the dump:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> repo.dump <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">svndumpfilter</span> <span style="color: #660033;">--drop-empty-revs</span> <span style="color: #660033;">--renumber-revs</span> include example_dragdrop <span style="color: #000000; font-weight: bold;">&gt;</span> example_dragdrop.dump
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">cat</span> repo.dump <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">svndumpfilter</span> <span style="color: #660033;">--drop-empty-revs</span> <span style="color: #660033;">--renumber-revs</span> include dedup <span style="color: #000000; font-weight: bold;">&gt;</span> dedup.dump</pre></div></div>

<p>I then editted these new dump files to change the name of the top folder from dedup/ and example_dragdrop/ respectively, to trunk/.   To do this was mostly a global exchange of <em>/^Node-path: example_dragdrop/</em>  to <em>/Node-path: trunk/</em>.    Dedup required an additional step as there were additional renames within the repo.  This required the updating of lines starting <em>/^Node-copyfrom-path:/</em>.</p>
<p>Once this was done, new repos could be created:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create example_dragdrop ; <span style="color: #c20cb9; font-weight: bold;">svnadmin</span> load example_dragdrop <span style="color: #000000; font-weight: bold;">&lt;</span> example_dragdrop.dump
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create dedup ; <span style="color: #c20cb9; font-weight: bold;">svnadmin</span> load dedup <span style="color: #000000; font-weight: bold;">&lt;</span> dedup.dump</pre></div></div>

<p>And that was pretty much it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/subversion-hackery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion ignore for Rails applications</title>
		<link>http://sampierson.com/blog/software-development/subversion-ignore-for-rails-applications/</link>
		<comments>http://sampierson.com/blog/software-development/subversion-ignore-for-rails-applications/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 15:21:40 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=90</guid>
		<description><![CDATA[Files in subversion workspaces can be ignored using the command:

svn propset svn:ignore &#60;pattern&#62; &#60;folder&#62;

Note however that properties do not stack!  If you execute the following:

svn propset svn:ignore &#34;*.sqlite3&#34; db
svn propset svn:ignore &#34;schema.rb&#34; db

then the second ignore statement will overwrite the first.  To ignore multiple files, you must provide a newline separated list; The most straightforward way [...]]]></description>
			<content:encoded><![CDATA[<p>Files in subversion workspaces can be ignored using the command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #000000; font-weight: bold;">&lt;</span>pattern<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>folder<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Note however that <strong>properties do not stack!</strong>  If you execute the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*.sqlite3&quot;</span> db
<span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;schema.rb&quot;</span> db</pre></div></div>

<p>then the second ignore statement will overwrite the first.  To ignore multiple files, you must provide a newline separated list; The most straightforward way to do this is to create a file, e.g. ignores.txt</p>

<div class="wp_syntax"><div class="code"><pre class="foo" style="font-family:monospace;">*.sqlite3
schema.rb</pre></div></div>

<p>then provide this to subversion:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #660033;">-F</span> ignores.txt db</pre></div></div>

<p>However if you know what you are doing you can do this on one line.  Using bash on Mac OS, typing Ctrl-V Ctrl-M will insert a newline into a string.  Putting in a \n, or just typing \ and then hitting enter, does not work.</p>
<p>There is also a way to set global ignores in subversion.  Edit you ~/.subversion/config file and add a global-ignores line:</p>

<div class="wp_syntax"><div class="code"><pre class="conf" style="font-family:monospace;">global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store</pre></div></div>

<div>So given these ground rules, here is my ignore regimen for Rails:</div>
<div>
<ul>
<li>.DS_Store files are generated by the Mac OS X Finder, and therefore as they are platform specific, we should let the user responsible for the platform take care of them using global ignores statement shown above.</li>
<li>Files which are going to be generated by ALL developers should be ignored by the repository itself, using svn propset svn:ignore.</li>
<li>Ignore log files, sqlite3 databases, temporary files.</li>
<li>The db/schema.rb file is questionable.  You can use it to recreate your database in one step, and it should only change when you alter a migration.  However in practice it seemed like it used to change a lot more often than that (like when you <em>ran</em> a migration), so was a pain to version.  It looks like that is fixed now, so let&#8217;s keep it.</li>
<li>For applications deployed in multiple places and for which the subversion repository is not secure, ignore database.yml</li>
</ul>
</div>
<p> </p>
<div>So here is my working set of svn commands:</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*.sqlite3&quot;</span> db
<span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*.log&quot;</span> log
<span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*&quot;</span> tmp<span style="color: #000000; font-weight: bold;">/</span>sessions tmp<span style="color: #000000; font-weight: bold;">/</span>cache tmp<span style="color: #000000; font-weight: bold;">/</span>sockets</pre></div></div>

<div>References:</div>
<div><a href="http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion" target="_blank">Howto User Rails With Subversion</a></div>
<div><a href="http://www.dr-chuck.com/csev-blog/000383.html" target="_blank">Preparing a Rails Application for SVN</a> (global-ignore)</div>
<div><a rel="bookmark" href="http://sdesmedt.wordpress.com/2006/12/10/how-to-make-subversion-ignore-files-and-folders/">How to … Make Subversion ignore files and folders</a> (svn -F option)</div>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/subversion-ignore-for-rails-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
