<?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>Ash Searle's Blog &#187; Subversion</title>
	<atom:link href="http://hexmen.com/blog/category/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://hexmen.com/blog</link>
	<description>On programming, and other things...</description>
	<lastBuildDate>Mon, 03 Jan 2011 16:21:36 +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 to work on OS X&#160;Tiger</title>
		<link>http://hexmen.com/blog/2008/08/getting-git-to-work-on-os-x-tiger/</link>
		<comments>http://hexmen.com/blog/2008/08/getting-git-to-work-on-os-x-tiger/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 11:58:10 +0000</pubDate>
		<dc:creator>Ash</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://hexmen.com/blog/?p=58</guid>
		<description><![CDATA[If you haven&#8217;t heard of git yet, it&#8217;s quickly becoming the preferred version-control system for tons of open-source projects, including the twin suns of ruby on rails and prototype. In fact, if you keep your eye on the github blog you&#8217;ll see a steady stream of well-known projects moving over to git, as diverse as [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard of <a href="http://en.wikipedia.org/wiki/Git_(software)">git</a> yet, it&#8217;s quickly becoming the preferred version-control system for tons of open-source projects, including the twin suns of <a href="http://github.com/rails/rails/tree/master">ruby on rails</a> and <a href="http://github.com/sstephenson/prototype/tree/master">prototype</a>.</p>
<p>In fact, if you keep your eye on the <a href="http://github.com/blog">github blog</a> you&#8217;ll see a steady stream of well-known projects moving over to git, as diverse as the <a href="http://github.com/joshuaclayton/blueprint-css/tree/master">Blueprint CSS framework</a> and the <a href="http://github.com/ghc-hq/ghc/tree/master">Haskell compiler</a>.</p>
<p>Basically, if <em>git</em> was a stock-market commodity, analysts would be issuing <strong>strong buy</strong> recommendations left, right and centre.  Git&#8217;s <a href="http://en.wikipedia.org/wiki/The_Tipping_Point">tipping-point</a> has arrived.</p>
<h3>How to play</h3>
<p><em>If you&#8217;ve arrived here via search-engine, it&#8217;s probably because you&#8217;re trying to work around errors like <strong>Can&#8217;t locate Error.pm</strong> or <strong>Can&#8217;t locate SVN/Core.pm</strong>.  Read on&#8230;</em></p>
<p>I already had macports installed, but if you haven&#8217;t, follow the <a href="http://www.macports.org/install.php">macports install instructions</a> &#8211; we&#8217;ll be using macports to download and install git as it&#8217;s supposed to be simpler than building from source.</p>
<p>If you&#8217;ve had macports installed a while, make sure it&#8217;s up to date:</p>
<pre><code>
$ sudo port selfupdate
</code></pre>
<p>We want to use git to connect to subversion repositories as well, so we&#8217;ll just check that&#8217;s possible:</p>
<pre><code>
$ port list variant:svn
git-core        @1.6.0  devel/git-core
subversion      @1.5.1  devel/subversion
</code></pre>
<p>I already had subversion installed but through trial-and-error found I needed to reinstall it with perl-bindings (git must be using perl scripts to talk to subversion&#8230;)  Note: I&#8217;m using the <code>-f</code> flag to force it to reinstall, you might want to try without first, just to see what conflicts it brings up:</p>
<pre><code>
$ sudo port uninstall -f subversion-perlbindings
$ sudo port install -f subversion-perlbindings
</code></pre>
<p>Next, we install git:</p>
<pre><code>
# This may take a while to install with all its dependencies:
$ sudo port install git-core +svn
</code></pre>
<p>And finally, we check it works:</p>
<pre><code>
$ mkdir myproject; cd myproject;

# Check your PATH's set properly, this should output:
# fatal: Not a git repository
$ git svn

# If that's OK... clone a repository:
$ git svn clone <em>http://example.com/svn/project/trunk</em>
</code></pre>
<h3>Can&#8217;t locate Error.pm</h3>
<p>If you&#8217;re getting <em>Can&#8217;t locate Error.pm</em> or <em>Can&#8217;t locate SVN/Core.pm</em> you should immediately try:</p>
<pre><code>
$ PATH=/opt/local/bin:$PATH git svn</code></pre>
<p>If that works, you know it&#8217;s just a PATH problem.  It&#8217;s something to do with Apple&#8217;s perl install having slightly kooky ideas about where to store perl libraries.</p>
<p>If you&#8217;re still getting complaints about Error.pm, you need to install the CPAN module &#8211; and we&#8217;re going to use the /opt/local/bin instance of cpan, to make sure things go in the right place for us:</p>
<pre><code>
$ sudo /opt/local/bin/cpan -i lib::Error
</code></pre>
<p>Cross your fingers, and try again:</p>
<pre><code>
$ PATH=/opt/local/bin:$PATH
$ git svn clone <em>http://example.com/svn/project/trunk</em>
</code></pre>
<p>If things are working, git will spend a while cloning the subversion repository by pulling out every single revision so you can have a complete set of revisions (including deltas), ready for you to refer to with lightning-speed regardless of internet connectivity.  Which is nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://hexmen.com/blog/2008/08/getting-git-to-work-on-os-x-tiger/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SVN log message encoding&#160;problem</title>
		<link>http://hexmen.com/blog/2008/08/svn-log-message-encoding-problem/</link>
		<comments>http://hexmen.com/blog/2008/08/svn-log-message-encoding-problem/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 11:03:12 +0000</pubDate>
		<dc:creator>Ash</dc:creator>
				<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://hexmen.com/blog/?p=55</guid>
		<description><![CDATA[It&#8217;s good practice to put useful commentary in the log message whenever you commit code to a repository. Today, I wrote a log message about centigrade and farenheit conversions, using the proper degree symbol °, but this triggered an encoding problem, resulting in an error message: macbook:~/projects/smarty ash$ svn ci plugins/function.temperature.php svn: Commit failed (details [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s good practice to put useful commentary in the log message whenever you commit code to a repository.</p>
<p>Today, I wrote a log message about centigrade and farenheit conversions, using the proper degree symbol °, but this triggered an encoding problem, resulting in an error message:</p>
<pre>
macbook:~/projects/smarty ash$ svn ci plugins/function.temperature.php
svn: Commit failed (details follow):
<b>svn: Can't convert string from native encoding to 'UTF-8':</b>
svn: Tweak: altered temperature title attribute so it contains both farenheight AND
centigrade.  e.g. "88?\194?\176F or 17?\194?\176C".  The order is switched depending on user
preference.
--This line, and those below, will be ignored--

M    function.temperature.php

svn: Your commit message was left in a temporary file:
svn:    '/Users/ash/projects/propagandr/smarty/plugins/svn-commit.tmp'
</pre>
<p>It didn&#8217;t take long to realize although my editor (vim) was configured to use UTF-8, the subversion command-line client had no way of knowing that.</p>
<p>One way of stopping this happening again would be to set my locale permanently so the character-type is UTF-8 (e.g. <code>export LC_CTYPE=en.UTF-8</code>.)  But, as a short-term one-off fix, avoiding retyping the log message (and a little off-topic: remembering subversion ignores filenames mentioned in log messages, forcing you to reenter them on the command-line again) &#8211; the simple fix was:</p>
<pre>ash$ <code>LC_CTYPE=en_GB.UTF-8 svn ci -F plugins/svn-commit.tmp plugins/function.temperature.php</code></pre>
<p>Worked like a charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://hexmen.com/blog/2008/08/svn-log-message-encoding-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

