<?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>Jabbering Giraffe &#187; git</title>
	<atom:link href="http://happygiraffe.net/blog/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://happygiraffe.net/blog</link>
	<description></description>
	<lastBuildDate>Wed, 19 Oct 2011 10:40:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Changing the committer</title>
		<link>http://happygiraffe.net/blog/2009/09/01/changing-the-committer/</link>
		<comments>http://happygiraffe.net/blog/2009/09/01/changing-the-committer/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 22:10:37 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1605</guid>
		<description><![CDATA[Quite often, I find myself using git for non-work related activity on my work laptop. Yeah, yeah, I know. Normally, I remember to set my email to be my home address before starting work. $ mymail='dom [at] happygiraffe (dot) net' &#8230; <a href="http://happygiraffe.net/blog/2009/09/01/changing-the-committer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Quite often, I find myself using git for non-work related activity on my work laptop.  Yeah, yeah, I know.</p>
<p>Normally, I remember to set my email to be my home address before starting work.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">mymail</span>=<span style="color: #ff0000;">'dom [at] happygiraffe (dot) net'</span>
$ <span style="color: #c20cb9; font-weight: bold;">git</span> config user.email <span style="color: #007800;">$mymail</span></pre></div></div>

<p>Of course, you&#8217;d use your proper email address, instead of that obfuscated form.</p>
<p>Note that we <em>don&#8217;t</em> use <code>--global</code>.  This change is specific to the repository that we&#8217;re working in.</p>
<p>Unfortunately, I usually just dive in and start working.  About four or five commits down the line, I realise I&#8217;ve screwed up.  What then?</p>
<p><a href="http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html"><code>git filter-branch</code></a> to the rescue!  We just need to change a couple of environment variables and redo each commit.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> filter-branch <span style="color: #660033;">--env-filter</span> <span style="color: #ff0000;">&quot;export GIT_AUTHOR_EMAIL=<span style="color: #007800;">$mymail</span> GIT_COMMITTER_EMAIL=<span style="color: #007800;">$mymail</span>&quot;</span> master
Rewrite 0c5299bf98bf30938bb1d0fc0211aa9f3a9ddcf8 <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
Ref <span style="color: #ff0000;">'refs/heads/master'</span> was rewritten</pre></div></div>

<p>Like all uses of filter-branch, you should only do this on an unpublished repository, as it&#8217;s effectively altering history.</p>
<p>There is a reference to the original commits left behind, in case I screwed something up.  When you&#8217;ve checked that everything looks OK, you can <a href="http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html#_checklist_for_shrinking_a_repository">clean up</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> for-each-ref <span style="color: #660033;">--format</span>=<span style="color: #ff0000;">&quot;%(refname)&quot;</span> refs<span style="color: #000000; font-weight: bold;">/</span>original<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #c20cb9; font-weight: bold;">git</span> update-ref <span style="color: #660033;">-d</span>
$ <span style="color: #c20cb9; font-weight: bold;">git</span> reflog expire <span style="color: #660033;">--expire</span>=now <span style="color: #660033;">--all</span>
$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">gc</span> <span style="color: #660033;">--prune</span>=now
Counting objects: <span style="color: #000000;">9</span>, done.
Delta compression using up to <span style="color: #000000;">2</span> threads.
Compressing objects: <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">7</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">7</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, done.
Writing objects: <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, done.
Total <span style="color: #000000;">9</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>delta <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, reused <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>delta <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/09/01/changing-the-committer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>temporarily ignoring files in git</title>
		<link>http://happygiraffe.net/blog/2009/08/24/temporarily-ignoring-files-in-git/</link>
		<comments>http://happygiraffe.net/blog/2009/08/24/temporarily-ignoring-files-in-git/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 23:08:08 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1596</guid>
		<description><![CDATA[Quite often, you want to change a file temporarily whilst you work on something, but you know you don&#8217;t want to commit it. Right now I want to change my project&#8217;s logging from INFO to DEBUG, but I don&#8217;t want &#8230; <a href="http://happygiraffe.net/blog/2009/08/24/temporarily-ignoring-files-in-git/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Quite often, you want to change a file temporarily whilst you work on something, but you know you don&#8217;t want to commit it.  Right now I want to change my project&#8217;s logging from INFO to DEBUG, but I don&#8217;t want to commit that.</p>
<p>There&#8217;s a command <a href="http://www.kernel.org/pub/software/scm/git/docs/git-update-index.html">git update-index</a> which has a flag <code>--assume-unchanged</code>.  And it just makes those files ignored for a while.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
<span style="color: #666666; font-style: italic;"># On branch master</span>
<span style="color: #666666; font-style: italic;"># Changed but not updated:</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	modified:   src/main/webapp/WEB-INF/log4j.xml</span>
<span style="color: #666666; font-style: italic;">#</span>
no changes added to commit <span style="color: #7a0874; font-weight: bold;">&#40;</span>use <span style="color: #ff0000;">&quot;git add&quot;</span> and<span style="color: #000000; font-weight: bold;">/</span>or <span style="color: #ff0000;">&quot;git commit -a&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
$ <span style="color: #c20cb9; font-weight: bold;">git</span> update-index <span style="color: #660033;">--assume-unchanged</span> src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>webapp<span style="color: #000000; font-weight: bold;">/</span>WEB-INF<span style="color: #000000; font-weight: bold;">/</span>log4j.xml
$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
<span style="color: #666666; font-style: italic;"># On branch master</span>
nothing to commit <span style="color: #7a0874; font-weight: bold;">&#40;</span>working directory clean<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Easy!  Now, edit away.</p>
<p>… time passes …</p>
<p>And now to get everything back to normal.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> update-index <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--really-refresh</span>
src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>webapp<span style="color: #000000; font-weight: bold;">/</span>WEB-INF<span style="color: #000000; font-weight: bold;">/</span>log4j.xml: needs update
$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
<span style="color: #666666; font-style: italic;"># On branch master</span>
<span style="color: #666666; font-style: italic;"># Changed but not updated:</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git add &lt;file&gt;...&quot; to update what will be committed)</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git checkout -- &lt;file&gt;...&quot; to discard changes in working directory)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	modified:   src/main/webapp/WEB-INF/log4j.xml</span>
<span style="color: #666666; font-style: italic;">#</span>
no changes added to commit <span style="color: #7a0874; font-weight: bold;">&#40;</span>use <span style="color: #ff0000;">&quot;git add&quot;</span> and<span style="color: #000000; font-weight: bold;">/</span>or <span style="color: #ff0000;">&quot;git commit -a&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>I have to be honest, this is slightly hacky.  It would be nice to be able to tell git &#8220;ignore this change,&#8221; in the way you can say &#8220;add this change&#8221;.  But it works OK for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/08/24/temporarily-ignoring-files-in-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solr&#039;s Lucene Source</title>
		<link>http://happygiraffe.net/blog/2009/07/16/solrs-lucene-source/</link>
		<comments>http://happygiraffe.net/blog/2009/07/16/solrs-lucene-source/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 22:15:19 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1558</guid>
		<description><![CDATA[I&#8217;m debugging a plugin for Solr. I&#8217;ve just about got the magic voodoo set up so that I can make Eclipse talk to tomcat and stick breakpoints in and so on. But I&#8217;ve immediately run into a problem. Even though &#8230; <a href="http://happygiraffe.net/blog/2009/07/16/solrs-lucene-source/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m debugging a plugin for <a href="http://lucene.apache.org/solr/">Solr</a>.  I&#8217;ve just about got the magic voodoo set up so that I can make Eclipse talk to tomcat and stick breakpoints in and so on.  But I&#8217;ve immediately run into a problem.</p>
<p>Even though Solr itself comes with <code>-sources</code> jars, the bundled copy of lucene that they&#8217;ve used <em>doesn&#8217;t</em>.  Needless to say, this is a bit of a hindrance.</p>
<p>Thankfully, the apache people have set up <a href="http://git.apache.org/">git.apache.org</a>, which makes this situation a lot less annoying than it could be.</p>
<p>First, I checked out copies of lucene &#038; solr.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>git.apache.org<span style="color: #000000; font-weight: bold;">/</span>solr.git
$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>git.apache.org<span style="color: #000000; font-weight: bold;">/</span>lucene.git</pre></div></div>

<p>Now, I need to go into solr and figure out <em>which</em> version of lucene is in use.  Unfortunately, it&#8217;s not a released version, it&#8217;s a snapshot of the lucene trunk at a point in time.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> …<span style="color: #000000; font-weight: bold;">/</span>solr
$ <span style="color: #c20cb9; font-weight: bold;">git</span> branch <span style="color: #660033;">-r</span>
  origin<span style="color: #000000; font-weight: bold;">/</span>HEAD -<span style="color: #000000; font-weight: bold;">&gt;</span> origin<span style="color: #000000; font-weight: bold;">/</span>trunk
  origin<span style="color: #000000; font-weight: bold;">/</span>branch-<span style="color: #000000;">1.1</span>
  origin<span style="color: #000000; font-weight: bold;">/</span>branch-<span style="color: #000000;">1.2</span>
  origin<span style="color: #000000; font-weight: bold;">/</span>branch-<span style="color: #000000;">1.3</span>
  origin<span style="color: #000000; font-weight: bold;">/</span>sandbox
  origin<span style="color: #000000; font-weight: bold;">/</span>solr-ruby-refactoring
  origin<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>release-1.1.0
  origin<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>release-1.2.0
  origin<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>release-1.3.0
  origin<span style="color: #000000; font-weight: bold;">/</span>trunk
$ <span style="color: #c20cb9; font-weight: bold;">git</span> whatchanged origin<span style="color: #000000; font-weight: bold;">/</span>tags<span style="color: #000000; font-weight: bold;">/</span>release-1.3.0 lib
…
commit 904e378b7b4fd18232f657c9daf484a3e63b272c
Author: Yonik Seeley <span style="color: #000000; font-weight: bold;">&lt;</span>yonik<span style="color: #000000; font-weight: bold;">@</span>apache.org<span style="color: #000000; font-weight: bold;">&gt;</span>
Date:   Wed Sep <span style="color: #000000;">3</span> <span style="color: #000000;">20</span>:<span style="color: #000000;">31</span>:<span style="color: #000000;">42</span> <span style="color: #000000;">2008</span> +0000
&nbsp;
    lucene update <span style="color: #000000;">2.4</span>-dev r691741
&nbsp;
    git-svn-id: https:<span style="color: #000000; font-weight: bold;">//</span>svn.apache.org<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>asf<span style="color: #000000; font-weight: bold;">/</span>lucene<span style="color: #000000; font-weight: bold;">/</span>solr<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>branch-<span style="color: #000000;">1.3</span><span style="color: #000000; font-weight: bold;">@</span>691758 13f79535-47bb-0310-<span style="color: #000000;">9956</span>-ffa450edef68
&nbsp;
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> a297b74... 54442dc... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-analyzers-<span style="color: #000000;">2.4</span>-dev.jar
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> 596625b... 5c6e003... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-core-<span style="color: #000000;">2.4</span>-dev.jar
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> db13718... f0f93a7... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-highlighter-<span style="color: #000000;">2.4</span>-dev.jar
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> 50c8cb4... a599f43... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-memory-<span style="color: #000000;">2.4</span>-dev.jar
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> aef3fb8... 79feaef... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-queries-<span style="color: #000000;">2.4</span>-dev.jar
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> 1c733b9... 440fa4e... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-snowball-<span style="color: #000000;">2.4</span>-dev.jar
:<span style="color: #000000;">100644</span> <span style="color: #000000;">100644</span> 0195fa2... b5ff08b... M  lib<span style="color: #000000; font-weight: bold;">/</span>lucene-spellchecker-<span style="color: #000000;">2.4</span>-dev.jar
…</pre></div></div>

<p>So, the last change to lucene was taking a copy of r691741 of lucene&#8217;s trunk.  So, lets go over there.  And see what that looks like.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> …<span style="color: #000000; font-weight: bold;">/</span>lucene
$ <span style="color: #c20cb9; font-weight: bold;">git</span> log <span style="color: #660033;">--grep</span>=<span style="color: #000000;">691741</span></pre></div></div>

<p>Except that doesn&#8217;t return anything.  Because there was no lucene commit at that revision in the original repository (it was <a href="http://svn.apache.org/viewvc?view=rev&#038;revision=691741">something to do with geronimo</a>).  So we need to search backwards for the commit nearest to that revision.  Thankfully, <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git svn</a> includes the original subversion revision numbers of each commit.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> …<span style="color: #000000; font-weight: bold;">/</span>lucene
$ <span style="color: #c20cb9; font-weight: bold;">git</span> log <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-lne</span> <span style="color: #ff0000;">'if (m/git-svn-id:.*@(\d+)/ &amp;&amp; $1 &lt;= 691741){print $1; exit}'</span>
<span style="color: #000000;">691694</span></pre></div></div>

<p>So now we can go back and find the git commit id that corresponds.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> …<span style="color: #000000; font-weight: bold;">/</span>lucene
$ <span style="color: #c20cb9; font-weight: bold;">git</span> log <span style="color: #660033;">--grep</span>=<span style="color: #000000;">691694</span>
commit 71afff2cebd022fe63bdf2ec4b87aaa0cee41dc8
Author: Michael McCandless <span style="color: #000000; font-weight: bold;">&lt;</span>mikemccand<span style="color: #000000; font-weight: bold;">@</span>apache.org<span style="color: #000000; font-weight: bold;">&gt;</span>
Date:   Wed Sep <span style="color: #000000;">3</span> <span style="color: #000000;">17</span>:<span style="color: #000000;">34</span>:<span style="color: #000000;">29</span> <span style="color: #000000;">2008</span> +0000
&nbsp;
    LUCENE-<span style="color: #000000;">1374</span>: fix <span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #000000; font-weight: bold;">case</span> to close reader<span style="color: #000000; font-weight: bold;">/</span>writer <span style="color: #000000; font-weight: bold;">in</span> try<span style="color: #000000; font-weight: bold;">/</span>finally; add assert b<span style="color: #000000; font-weight: bold;">!</span>=null <span style="color: #000000; font-weight: bold;">in</span> RAMOutputStream.writeBytes <span style="color: #7a0874; font-weight: bold;">&#40;</span>matches FSIndexOutput <span style="color: #c20cb9; font-weight: bold;">which</span> hits NPE<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
    git-svn-id: https:<span style="color: #000000; font-weight: bold;">//</span>svn.apache.org<span style="color: #000000; font-weight: bold;">/</span>repos<span style="color: #000000; font-weight: bold;">/</span>asf<span style="color: #000000; font-weight: bold;">/</span>lucene<span style="color: #000000; font-weight: bold;">/</span>java<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">@</span>691694 13f79535-47bb-0310-<span style="color: #000000;">9956</span>-ffa450edef68</pre></div></div>

<p>Hurrah!  Now I can checkout the same version of Lucene that&#8217;s in Solr.  But, probably more useful for Eclipse, is just to zip it up somewhere.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> …<span style="color: #000000; font-weight: bold;">/</span>lucene
$ <span style="color: #c20cb9; font-weight: bold;">git</span> archive <span style="color: #660033;">--format</span>=<span style="color: #c20cb9; font-weight: bold;">zip</span> 71afff2 <span style="color: #000000; font-weight: bold;">&gt;/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>lucene-<span style="color: #000000;">2.4</span>-r691741.zip</pre></div></div>

<p>Excellent.  Now I can resume my debugging session. <img src='http://happygiraffe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>NB: I <em>could</em> have just used subversion to check out the correct revision of Lucene.  But, I find it quicker to use git to clone the repository, and I get the added benefit that I now have the whole lucene history available.  So I can quickly see <em>why</em> something was changed.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/07/16/solrs-lucene-source/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Publishing a subdirectory to github pages</title>
		<link>http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/</link>
		<comments>http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 01:06:29 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[jslint4java]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1545</guid>
		<description><![CDATA[I&#8217;ve written some HTML documentation for jslint4java. It lives in jslint4java-docs/src/main/resources in typical maven fashion. I&#8217;d like to get it published on github pages. The starting point is similar to their documentation. git symbolic-ref HEAD refs/heads/gh-pages rm .git/index git clean &#8230; <a href="http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written some HTML documentation for <a href="http://code.google.com/p/jslint4java/">jslint4java</a>.  It lives in <a href="http://github.com/happygiraffe/jslint4java/tree/d9c53ab241c90a46dc9c551fe1bc96ec650608c5/jslint4java-docs/src/main/resources">jslint4java-docs/src/main/resources</a> in typical maven fashion.  I&#8217;d like to get it published on <a href="http://pages.github.com/">github pages</a>.</p>
<p>The starting point is similar to their documentation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> symbolic-ref HEAD refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>gh-pages
<span style="color: #c20cb9; font-weight: bold;">rm</span> .git<span style="color: #000000; font-weight: bold;">/</span>index
<span style="color: #c20cb9; font-weight: bold;">git</span> clean <span style="color: #660033;">-fdx</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;My GitHub Page&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> index.html
<span style="color: #c20cb9; font-weight: bold;">git</span> add .
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;First pages commit&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> push origin gh-pages</pre></div></div>

<p>That lands us with a brand spanking new branch to play with.  What I&#8217;d like to do is make a new commit on that branch, but from a tree which is <em>already in my repository</em>.  The magic word is <a href="http://www.kernel.org/pub/software/scm/git/docs/git-commit-tree.html"><code>git commit-tree</code></a>.  It needs two things: the id of the tree and the id of the parent commit to attach to.</p>
<p>The parent to attach to is easy.  It&#8217;s the tip of the <code>gh-pages</code> branch we just made.  <a href="http://www.kernel.org/pub/software/scm/git/docs/git-show-ref.html"><code>git show-ref</code></a> will let us know the id.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> show-ref <span style="color: #660033;">-s</span> refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>gh-pages
0a0c2a4ef1f9421b6f9537472c0f04fd6485d2cc</pre></div></div>

<p>The next bit is the tree we want to commit.  <a href="http://www.kernel.org/pub/software/scm/git/docs/git-ls-tree.html"><code>git ls-tree</code></a> is the tool for the job.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> ls-tree <span style="color: #660033;">-d</span> HEAD jslint4java-docs<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>resources
040000 <span style="color: #c20cb9; font-weight: bold;">tree</span> 5feb5926c39b5e6af3a51feb04750c819bf08b94	jslint4java-docs<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>resources</pre></div></div>

<p><code>git commit-tree</code> will return the id of the new commit it just created.  All that remains is to <a href="http://www.kernel.org/pub/software/scm/git/docs/git-update-ref.html">update</a> the <code>gh-pages</code> branch to point at it.</p>
<p>Pulling it all together, we have:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">parent_sha</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">git</span> show-ref <span style="color: #660033;">-s</span> refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>gh-pages<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">doc_sha</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">git</span> ls-tree <span style="color: #660033;">-d</span> HEAD jslint4java-docs<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>resources <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">new_commit</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Auto-update docs.&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">git</span> commit-tree <span style="color: #007800;">$doc_sha</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$parent_sha</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> update-ref refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>gh-pages <span style="color: #007800;">$new_commit</span></pre></div></div>

<p>This isn&#8217;t ideal — it won&#8217;t automatically track updates to that directory.  But it&#8217;s easy enough to run this once in a while to publish an update.</p>
<p>The end result is that my documentation is <a href="http://happygiraffe.github.com/jslint4java/">published</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Mercurial support on Google Code</title>
		<link>http://happygiraffe.net/blog/2009/04/25/mercurial-support-on-google-code/</link>
		<comments>http://happygiraffe.net/blog/2009/04/25/mercurial-support-on-google-code/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 13:38:46 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1509</guid>
		<description><![CDATA[Google Code Blog: Mercurial support for Project Hosting on Google Code: We are happy to announce that Project Hosting on Google Code now supports the Mercurial version control system in addition to Subversion. This is great news. I love git, &#8230; <a href="http://happygiraffe.net/blog/2009/04/25/mercurial-support-on-google-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://google-code-updates.blogspot.com/2009/04/mercurial-support-for-project-hosting.html"><p><a href="http://google-code-updates.blogspot.com/2009/04/mercurial-support-for-project-hosting.html">Google Code Blog: Mercurial support for Project Hosting on Google Code</a>: We are happy to announce that Project Hosting on Google Code now supports the Mercurial version control system in addition to Subversion.</p>
</blockquote>
<p>This is great news.  I love <a href="http://www.git-scm.com/">git</a>, but <a href="http://www.selenic.com/mercurial">mercurial</a> is also widely used by many projects (Python, Mozilla, …).  Bringing <a href="http://en.wikipedia.org/wiki/Distributed_revision_control" title="Distributed Version Constrol System">DVCS</a>s to a wider audience can only be a good thing.  The freedom of making everyone a &#8220;committer&#8221; is awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/04/25/mercurial-support-on-google-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching through all revisions</title>
		<link>http://happygiraffe.net/blog/2009/02/05/searching-through-all-revisions/</link>
		<comments>http://happygiraffe.net/blog/2009/02/05/searching-through-all-revisions/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 11:18:26 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1468</guid>
		<description><![CDATA[A colleague was asking: I&#8217;m trying to work out a technique for searching for an occurrence of a phrase in _all_ revisions of a specific file in a subversion repository. How can I do this? Of course, in subversion, the &#8230; <a href="http://happygiraffe.net/blog/2009/02/05/searching-through-all-revisions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A colleague was asking:</p>
<blockquote><p>
I&#8217;m trying to work out a technique for searching for an occurrence of a phrase in _all_ revisions of a specific file in a subversion repository.  How can I do this?
</p></blockquote>
<p>Of course, in subversion, the answer is slow and complicated.  But, you can use <a href="http://git-scm.com/">git</a> (and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git svn</a> in particular) to achieve the answer fairly simply (and much more quickly).</p>
<p>First, you just clone the subversion repository into git.  This takes a while, mostly because subversion isn&#8217;t that quick.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #660033;">-s</span> https:<span style="color: #000000; font-weight: bold;">//</span>svn.example.com<span style="color: #000000; font-weight: bold;">/</span>proj</pre></div></div>

<p>Then, you can wrap a little bit of shell scripting around git to get what you need.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #7a0874; font-weight: bold;">cd</span> proj
  <span style="color: #c20cb9; font-weight: bold;">git</span> branch <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> tags<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> tag
  <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #660033;">--no-pager</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">'something'</span> <span style="color: #007800;">$tag</span> <span style="color: #660033;">--</span> some<span style="color: #000000; font-weight: bold;">/</span>file.txt
  <span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>So, we pull out a list of tags, and run <a href="http://www.kernel.org/pub/software/scm/git/docs/git-grep.html">git grep</a> over each one.</p>
<p>There may well be a more effective way to do this, but hey, it took seconds to come up with.  And it shows off the reason I like git — it&#8217;s so <em>scriptable</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/02/05/searching-through-all-revisions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>git tree</title>
		<link>http://happygiraffe.net/blog/2009/01/27/git-tree/</link>
		<comments>http://happygiraffe.net/blog/2009/01/27/git-tree/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 13:27:12 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1461</guid>
		<description><![CDATA[Just a quick one based on today&#8217;s git ready: text-based graph. That describes how to get nice ascii-charts of your git repo. But the command is too long to type. So: git config --global alias.tree 'log --graph --pretty=oneline' Now, I &#8230; <a href="http://happygiraffe.net/blog/2009/01/27/git-tree/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick one based on today&#8217;s git ready: <a href="http://gitready.com/2009/01/26/text-based-graph.html">text-based graph</a>.  That describes how to get nice ascii-charts of your git repo.  But the command is too long to type.  So:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> alias.tree <span style="color: #ff0000;">'log --graph --pretty=oneline'</span></pre></div></div>

<p>Now, I can just do <code>git tree</code>.  Lovely.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/01/27/git-tree/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Github Pages with Maven</title>
		<link>http://happygiraffe.net/blog/2009/01/17/github-pages-with-maven/</link>
		<comments>http://happygiraffe.net/blog/2009/01/17/github-pages-with-maven/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 00:44:38 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1454</guid>
		<description><![CDATA[Github recently introduced their pages feature, for serving static content. This sounds like an ideal match for a maven , so I thought I&#8217;d give it a go. I managed to get happygiraffe.github.com/tclogview/ up and running in fairly short order, &#8230; <a href="http://happygiraffe.net/blog/2009/01/17/github-pages-with-maven/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/">Github</a> recently introduced their <a href="http://github.com/blog/272-github-pages">pages</a> feature, for serving static content.  This sounds like an ideal match for a <a href="http://maven.apache.org/plugins/maven-site-plugin/">maven </a>, so I thought I&#8217;d give it a go.  I managed to get <a href="http://happygiraffe.github.com/tclogview/">happygiraffe.github.com/tclogview/</a> up and running in fairly short order, but I&#8217;m not totally happy with the end result.  And that&#8217;s not <em>just</em> the fault of the default maven site.</p>
<p>First things first.  We need to set up the gh-pages branch as devoid of content.  I nicked most of this from drnic&#8217;s <a href="http://maven.apache.org/plugins/maven-site-plugin/">sake-tasks</a>, even though the instructions are also on <a href="http://pages.github.com/">pages.github.com</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> symbolic-ref HEAD refs<span style="color: #000000; font-weight: bold;">/</span>heads<span style="color: #000000; font-weight: bold;">/</span>gh-pages
<span style="color: #c20cb9; font-weight: bold;">rm</span> .git<span style="color: #000000; font-weight: bold;">/</span>index
<span style="color: #c20cb9; font-weight: bold;">git</span> clean <span style="color: #660033;">-fdx</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&lt;h1&gt;Coming soon!&lt;/h1&gt;&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span>index.html
<span style="color: #c20cb9; font-weight: bold;">git</span> add index.html
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">'Initial page'</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> push origin gh-pages</pre></div></div>

<p>Soon, you should be able to see the &#8220;Coming soon!&#8221; message on <code>you.github.com/yourproj/</code>.</p>
<p>Now that&#8217;s there, we need to set it up so that maven can deploy the site to it.  First, let&#8217;s add the branch as a <a href="http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html">submodule</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">repo</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">git</span> config remote.origin.url<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> submodule add <span style="color: #660033;">-b</span> gh-pages <span style="color: #007800;">$repo</span> site</pre></div></div>

<p>That should create a directory &#8220;site&#8221; which contains the index.html you committed a moment ago.  Now you have to ask Maven to deploy the site there.  Add this to your POM.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;distributionManagement<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;site<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>gh-pages<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- This gets automatically pushed to the gh-pages branch. --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>file:${project.basedir}/site<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/site<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/distributionManagement<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now you can say <code>mvn site-deploy</code> and it will fill up the site directory with lots of lovely HTML.  Then you have to commit it (separately, since it&#8217;s a submodule) and push it back to github.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  mvn site-deploy
  <span style="color: #7a0874; font-weight: bold;">&#40;</span>
    <span style="color: #7a0874; font-weight: bold;">cd</span> site
    <span style="color: #c20cb9; font-weight: bold;">git</span> add .
    <span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-a</span> <span style="color: #660033;">-m</span> <span style="color: #ff0000;">'Generate site.'</span>
    <span style="color: #c20cb9; font-weight: bold;">git</span> push origin gh-pages
  <span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>And shortly thereafter it shows up on the web site.  Magic.</p>
<p>I like this a lot in principal.  But I have a few issues with it as well.  Mostly, this is down to git submodules being quite a blunt instrument:</p>
<ul>
<li>They don&#8217;t auto-update when there&#8217;s a new commit in the submodule — they point at a fixed commit.  You have to ask for it to be updated.</li>
<li>On top of that, you can&#8217;t point the submodule at a branch.  It&#8217;s always pointing at a specific commit.</li>
<li>The submodule location is recorded in <code>.gitmodules</code>.  The main issue I have with this is I can&#8217;t find a way to say &#8220;my current repository&#8221;.  Why is this a problem?  Well, if somebody forks the codebase (and they will, this is git) then they want their site to point at <em>their</em> gh-pages branch, not mine.</li>
<li>The submodule location is my private push URL, not the public one.  Which is all well and good, but when somebody checks out the project, they&#8217;re going to have an error when they try to check it out.  As I found out when setting up the build in <a href="https://hudson.dev.java.net/">hudson</a>.</li>
<li>When somebody else checks out the repository they have an extra step to go through to fetch the submodule contents (<code>git submodule init  git submodule update</code>).</li>
</ul>
<p>I think that next time I try this, I&#8217;ll skip submodules and just checkout a second copy of the repo in <code>../project-site</code>.</p>
<p>I still think it&#8217;s the right way to go.  Not just for the site, but you can also use github pages to serve up a maven repository in a very similar fashion.  Github and maven do seem to go together rather well.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2009/01/17/github-pages-with-maven/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Commit Messages</title>
		<link>http://happygiraffe.net/blog/2008/12/18/commit-messages/</link>
		<comments>http://happygiraffe.net/blog/2008/12/18/commit-messages/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 22:17:46 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1434</guid>
		<description><![CDATA[I&#8217;ve been using git for most of this year. It&#8217;s been a really excellent ride, and the things it enables are wonderful. But one of the things I&#8217;ve found most handy is a convention. The commit message is treated like &#8230; <a href="http://happygiraffe.net/blog/2008/12/18/commit-messages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://git.or.cz/">git</a> for most of this year.  It&#8217;s been a really excellent ride, and the things it enables are wonderful.  But one of the things I&#8217;ve found most handy is a <em>convention</em>.</p>
<p>The commit message is <a href="http://www.kernel.org/pub/software/scm/git/docs/git-commit.html#_discussion">treated like an email</a>: one line of subject and then a few paragraphs of explanation.  Keep the subject line short so you don&#8217;t have scroll bars when they&#8217;re displayed.</p>
<p>This works really well for scanning the history of a project — you can get at at a glance overview of what&#8217;s changed and then click on a single commit for more detail.  I&#8217;ve tried to carry this over to subversion projects as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2008/12/18/commit-messages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The best subversion client</title>
		<link>http://happygiraffe.net/blog/2008/11/20/the-best-subversion-client/</link>
		<comments>http://happygiraffe.net/blog/2008/11/20/the-best-subversion-client/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 10:20:54 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1412</guid>
		<description><![CDATA[The best subversion client I&#8217;ve used to date? git. It&#8217;s so script-friendly! This morning somebody asked me for a complete history of a project in CSV format. Using my nicely cloned repository, it was a simple matter of giving the &#8230; <a href="http://happygiraffe.net/blog/2008/11/20/the-best-subversion-client/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The best subversion client I&#8217;ve used to date?  <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html"><code>git</code></a>.  It&#8217;s <em>so</em> script-friendly!  This morning somebody asked me for a complete history of a project in CSV format.  Using my nicely cloned repository, it was a simple matter of giving the correct format to <a href="http://www.kernel.org/pub/software/scm/git/docs/git-log.html#_pretty_formats">git log</a>.</p>
<pre>
  &#x21D2; git log --pretty='format:%h,%ai,%an,%s' | head -5
  f584913,2008-09-26 21:58:02 +0000,Dominic Mitchell,Pull out a base class for OptionInstances.
  803a32a,2008-09-26 21:57:38 +0000,Dominic Mitchell,Organise imports.
  1cb0132,2008-09-26 21:57:17 +0000,Dominic Mitchell,Switch from a Set of OptionInstance to a Map from Option to OptionInstance.
  a0c1efd,2008-09-26 21:56:56 +0000,Dominic Mitchell,Introduce OptionInstance.
  a211ae3,2008-09-26 21:55:59 +0000,Dominic Mitchell,Use standard idiom for emptying a Set
</pre>
<p>I <em>love</em> how git embodies the Unix toolkit approach.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2008/11/20/the-best-subversion-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

