<?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>SmartLogic Solutions Blog &#187; Subversion</title>
	<atom:link href="http://blog.smartlogicsolutions.com/category/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com</link>
	<description>News and updates from the people at SmartLogic Solutions</description>
	<lastBuildDate>Tue, 30 Nov 2010 21:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting git-svn to run on OS X</title>
		<link>http://blog.smartlogicsolutions.com/2008/12/10/getting-git-svn-to-run-on-os-x/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/12/10/getting-git-svn-to-run-on-os-x/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 01:37:20 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=428</guid>
		<description><![CDATA[I&#8217;ve been gitting into git (clever, I know) lately, so I was trying to migrate my git commits for a project back into an existing subversion repository &#8211; another post coming on that later. When trying to run git-svn to import my subversion repository into git I got the following error, followed by a Perl [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been gitting into <a href="http://git.or.cz/">git</a> (clever, I know) lately, so I was trying to migrate my git commits for a project back into an existing subversion repository &#8211; another post coming on that later.</p>
<p>When trying to run <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a> to import my subversion repository into git I got the following error, followed by a Perl stack trace:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Can<span style="color: #ff0000;">'t locate Term/ReadKey.pm</span></pre></div></div>

<p>A couple of installs got this working, read on&#8230;</p>
<p><span id="more-428"></span></p>
<h4>Install Term::ReadKey</h4>
<p>To install <a href="http://search.cpan.org/dist/TermReadKey/ReadKey.pm">Term::ReadKey</a>, fire up a terminal and type (you may need to sudo):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
cpan<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">install</span> Term::ReadKey</pre></div></div>

<p>After a bunch of output I got the error message:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Writing Makefile <span style="color: #000000; font-weight: bold;">for</span> Term::ReadKey
    <span style="color: #660033;">--</span> NOT OK
Running <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #7a0874; font-weight: bold;">test</span>
  Can<span style="color: #ff0000;">'t test without successful make
Running make install
  make had returned bad status, install seems impossible</span></pre></div></div>

<p>I tried to see what was wrong with the Makefile by trying to run make in the TermKey folder:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">~<span style="color: #000000; font-weight: bold;">/</span>.cpan<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span>TermReadKey-<span style="color: #000000;">2.30</span> $<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
-bash: <span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #7a0874; font-weight: bold;">command</span> not found</pre></div></div>

<p>Interesting, didn&#8217;t realize OS X came preinstalled with things like perl but not make.</p>
<h4>Getting make on OS X</h4>
<p>I&#8217;m sure there&#8217;s an easier way to just get make on OS X, but I&#8217;m still new to my mac, so I wanted to install something supported by Apple instead of getting into stuff like ports.  After searching around on the Developer center I found that <a href="http://developer.apple.com/tools/xcode/">XCode</a> includes make.</p>
<p>After signing up for a free developer account and installing XCode, I now had make.</p>
<h4>Installing Term::ReadKey &#8211; round 2</h4>
<p>Let&#8217;s try this again&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
cpan<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">install</span> Term::ReadKey
&nbsp;
CPAN: Storable loaded ok
Going to <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>greg<span style="color: #000000; font-weight: bold;">/</span>.cpan<span style="color: #000000; font-weight: bold;">/</span>Metadata
  Database was generated on Wed, <span style="color: #000000;">10</span> Dec <span style="color: #000000;">2008</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">26</span>:<span style="color: #000000;">54</span> GMT
Term::ReadKey is up to date.</pre></div></div>

<p>Hurray!  Now git-svn is working on OS X.</p>
<p>Other relevant Mac/Git links:</p>
<ul>
<li><a href="http://code.google.com/p/git-osx-installer/">Git Installer for OS X</a></li>
<li><a href="http://git.or.cz/course/svn.html">Git Crash Course for SVN Users</a></li>
<ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/12/01/displaying-an-image-in-a-combobox/" rel="bookmark" class="crp_title">Displaying an Image in a ComboBox</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/02/01/setting-up-ubuntu-9-10-for-ruby-on-rails-development/" rel="bookmark" class="crp_title">Setting Up Ubuntu 9.10 for Ruby On Rails Development</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/04/introducing-environmentalize-an-intuitive-environment-focused-config-structure-for-your-rails-applications/" rel="bookmark" class="crp_title">Introducing environmentalist: an intuitive, environment-focused config structure for your rails applications</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/" rel="bookmark" class="crp_title">Introducing PureMVCGen &#8211; an ANT based PureMVC Flex Generator</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/07/subversion-timestamps-capistrano-finalize_update/" rel="bookmark" class="crp_title">Subversion Timestamps + Capistrano finalize_update</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/12/10/getting-git-svn-to-run-on-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Subclipse to Work in Gandymede (Eclipse 3.4)</title>
		<link>http://blog.smartlogicsolutions.com/2008/08/21/getting-subclipse-to-work-in-gandymede-eclipse-34/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/08/21/getting-subclipse-to-work-in-gandymede-eclipse-34/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 21:05:04 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[gandymede]]></category>
		<category><![CDATA[subclipse]]></category>
		<category><![CDATA[svnkit]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=162</guid>
		<description><![CDATA[I just upgraded Eclipse to 3.4 (Gandymede) since the latest upgrade to Flex Builder included support for Gandymede. I did my typical install by extracting the Gandymede tarball and then installed Subclipse through the Software updates (now in Help -> Software Updates&#8230;). It looked like everything installed okay but then when I tried to do [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded Eclipse to 3.4 (Gandymede) since the latest upgrade to Flex Builder included support for Gandymede.  I did my typical install by extracting the Gandymede tarball and then installed <a href="http://subclipse.tigris.org/">Subclipse</a> through the Software updates (now in Help -> Software Updates&#8230;).</p>
<p>It looked like everything installed okay but then when I tried to do an update in an existing project I got an error:</p>
<pre>"Unable to load default SVN Client"</pre>
<p>The key is to include the <del datetime="2008-08-22T14:49:28+00:00">SVNKit Adapter</del> JavaHL Adapter when you install Subclipse:<br />
<div id="attachment_171" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/javahl-subclipse.png"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/08/javahl-subclipse-300x174.png" alt="Include JavaHL when installing Subclipse." title="javahl-subclipse" width="300" height="174" class="size-medium wp-image-171" /></a><p class="wp-caption-text">Include JavaHL when installing Subclipse.</p></div></p>
<p>Hope that saves some people some time.</p>
<p><b>NOTE:</b> Thanks to <a href="#comment-212">Mark</a> for pointing out the recommended usage of JavaHL instead of SVNKit!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/11/12/watch-multiple-logs-in-a-single-terminal/" rel="bookmark" class="crp_title">Watch Multiple Logs in a Single Terminal</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/05/05/smartlogic-wants-to-clean-up-twitter-introduces-shouldirtcom/" rel="bookmark" class="crp_title">SmartLogic Wants to Clean Up Twitter, Introduces ShouldIRT.com</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/14/facebox-with-prototype/" rel="bookmark" class="crp_title">Facebox With Prototype</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/05/introducing-puremvcgen-an-ant-based-puremvc-flex-generator/" rel="bookmark" class="crp_title">Introducing PureMVCGen &#8211; an ANT based PureMVC Flex Generator</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/24/rack-rewrite-google-analytics-makes-site-transitions-seamless/" rel="bookmark" class="crp_title">Rack::Rewrite + Google Analytics Makes Site Transitions Seamless</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/08/21/getting-subclipse-to-work-in-gandymede-eclipse-34/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Subversion Timestamps + Capistrano finalize_update</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/07/subversion-timestamps-capistrano-finalize_update/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/06/07/subversion-timestamps-capistrano-finalize_update/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 00:21:13 +0000</pubDate>
		<dc:creator>John Trupiano</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[John Trupiano]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/07/subversion-timestamps-capistrano-finalize_update/</guid>
		<description><![CDATA[Update 2008/06/13: Jamis released Capistrano 2.4.0, and it includes the :normalize_asset_timestamps patch that I submitted! Update 2008/06/11: Here&#8217;s a link back to the Google Groups Discussion regarding this topic. Subversion has a lesser-known feature that allows you to specify that checkouts/exports/switches/reverts should timestamp files with the last committed timestamp. By default, this setting is turned [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 2008/06/13:</strong> Jamis released <a href="http://weblog.jamisbuck.org/2008/6/13/capistrano-2-4-0">Capistrano 2.4.0</a>, and it includes the :normalize_asset_timestamps patch that I submitted! </p>
<p><strong>Update 2008/06/11:</strong> Here&#8217;s a link back to the <a href="http://groups.google.com/group/capistrano/browse_thread/thread/f54286407f76c874">Google Groups Discussion</a> regarding this topic.</p>
<p>Subversion has a lesser-known feature that allows you to specify that checkouts/exports/switches/reverts should timestamp files with the last committed timestamp.  By default, this setting is turned off.  As such, when you checkout a repository, every file is timestamped with the current time on your local machine.</p>
<p>To be honest, I&#8217;m not quite sure why this is the default.  The <a href="http://svnbook.red-bean.com/en/1.4/svn.advanced.confarea.html#svn.advanced.confarea.opts.config">pertinent section of the Subversion manual</a> (you have to scroll to the bottom) describes the setting as such:</p>
<p>&#8212;&#8212;&#8212;-<br />
<i>use-commit-times</p>
<p>    Normally your working copy files have timestamps that reflect the last time they were touched by any process, whether that be your own editor or by some svn subcommand. This is generally convenient for people developing software, because build systems often look at timestamps as a way of deciding which files need to be recompiled.</p>
<p>    In other situations, however, it&#8217;s sometimes nice for the working copy files to have timestamps that reflect the last time they were changed in the repository. The svn export command always places these â€œlast-commit timestampsâ€ on trees that it produces. By setting this config variable to yes, the svn checkout, svn update, svn switch, and svn revert commands will also set last-commit timestamps on files that they touch.<br />
</i><br />
&#8212;&#8212;&#8212;-</p>
<p>It&#8217;s not clear to me why the default aids in Makefiles.  What is clear to me though is that Jamis Buck has taken this default behavior into account in <a href="http://www.capify.org">Capistrano</a>, the wonderful deployment tool we use at <a href="http://www.smartlogicsolutions.com">SLS</a>.</p>
<p>The following code snippets will require a bit of understanding of the built-in Capistrano deployment recipes.  Let&#8217;s take a look at the code for the :finalize_update task.  This task is invoked after the code has been updated on the server (for Subversion, either by an export or update).</p>
<pre>
  task :finalize_update, :except => { :no_release => true } do
    # ... other details omitted

    stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
    asset_paths = %w(images stylesheets javascripts).map { |p| "#{latest_release}/public/#{p}" }.join(" ")
    run "find #{asset_paths} -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
  end
</pre>
<p>What this snippet of code does is compute a timestamp, and then touch each asset file on the server with that timestamp (-t #{stamp}).  The intention for doing this was to handle the scenario where you have multiple asset servers.  Since an export/checkout updates the timestamp with the local machine&#8217;s current time, it&#8217;s possible for the same asset to have different timestamps on separate asset servers.</p>
<p>So what&#8217;s the big deal?  First, rails serves up images (when using the image_tag helper) with a querystring appended to it.  This querystring is simply a timestamp.  The reason for this is to support client-side caching (you&#8217;re doing this, right?).  This basically allows you to set the &#8220;expires&#8221; attribute of that file several years (decades or millenniums, in fact) into the future.  The reason this is so is because if that file ever changes, it&#8217;s last modified attribute will also change, effectively changing the querystring rails appends automatically, and causing your browser to download a &#8216;new asset.&#8217;  So, when the finalize_update task is invoked (which happens every time you re-deploy), all of these last-modified timestamps are reset, causing any repeat visitors to re-download these very same assets again.</p>
<p>I have submitted a patch to Jamis (which I hope he&#8217;ll apply soon!) that exposes an extra Capistrano parameter (:normalize_asset_timestamps), which would be set to true by default, leaving the original behavior in tact.  The new :finalize_update task looks like:</p>
<pre>
  task :finalize_update, :except => { :no_release => true } do
    # ... other details omitted

    if fetch(:normalize_asset_timestamps, true)
      stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
      asset_paths = %w(images stylesheets javascripts).map { |p| "#{latest_release}/public/#{p}" }.join(" ")
      run "find #{asset_paths} -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
    end
  end
</pre>
<p>I&#8217;ll follow up when/if Jamis accepts the patch.  Hopefully it can make it into version 2.4!</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/06/06/deploying-rails-apps-with-capistrano-without-root-or-sudo-privileges/" rel="bookmark" class="crp_title">Deploying Rails Apps with Capistrano without root or sudo Privileges</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/02/better-setup-for-environments-in-rails/" rel="bookmark" class="crp_title">Better setup for environments in Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/04/introducing-environmentalize-an-intuitive-environment-focused-config-structure-for-your-rails-applications/" rel="bookmark" class="crp_title">Introducing environmentalist: an intuitive, environment-focused config structure for your rails applications</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/02/01/setting-up-ubuntu-9-10-for-ruby-on-rails-development/" rel="bookmark" class="crp_title">Setting Up Ubuntu 9.10 for Ruby On Rails Development</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/21/advanced-model-based-searches-in-rails/" rel="bookmark" class="crp_title">Advanced Model Based searches in rails</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/06/07/subversion-timestamps-capistrano-finalize_update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

