<?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>tlrobinson.net / blog &#187; Git</title>
	<atom:link href="http://tlrobinson.net/blog/category/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://tlrobinson.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 06 Apr 2009 08:37:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='tlrobinson.net' port='80' path='/blog/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Ant Tasks for Git</title>
		<link>http://tlrobinson.net/blog/2008/11/13/ant-tasks-for-git/</link>
		<comments>http://tlrobinson.net/blog/2008/11/13/ant-tasks-for-git/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 06:20:30 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://tlrobinson.net/blog/?p=75</guid>
		<description><![CDATA[Ant has tasks for CVS and Subversion, but none that I could find for Git. I threw together these simple Ant macros to get started:

&#60;macrodef name = &#34;git&#34;&#62;
&#160;&#160;&#160;&#160;&#60;attribute name = &#34;command&#34; /&#62;
&#160;&#160;&#160;&#160;&#60;attribute name = &#34;dir&#34; default = &#34;&#34; /&#62;
&#160;&#160;&#160;&#160;&#60;element name = &#34;args&#34; optional = &#34;true&#34; /&#62;
&#160;&#160;&#160;&#160;&#60;sequential&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;echo message = &#34;git @{command}&#34; /&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;exec executable = &#34;git&#34; dir [...]]]></description>
			<content:encoded><![CDATA[<p>Ant has tasks for CVS and Subversion, but none that I could find for Git. I threw together these simple Ant macros to get started:</p>

<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#881280;">&lt;macrodef </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;git&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;attribute </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;command&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;attribute </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;dir&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">default</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;element </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;args&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">optional</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;true&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;sequential&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;echo </span><span style="color:#994500;">message</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;git @{command}&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;exec </span><span style="color:#994500;">executable</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;git&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">dir</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;@{dir}&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;arg </span><span style="color:#994500;">value</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;@{command}&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;args/&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/exec&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/sequential&gt;</span><br />
<span style="color:#881280;">&lt;/macrodef&gt;</span><br />
<br />
<span style="color:#881280;">&lt;macrodef </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;git-clone-pull&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;attribute </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;repository&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;attribute </span><span style="color:#994500;">name</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;dest&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;sequential&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;git </span><span style="color:#994500;">command</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;clone&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;args&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;arg </span><span style="color:#994500;">value</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;@{repository}&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;arg </span><span style="color:#994500;">value</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;@{dest}&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/args&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/git&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;git </span><span style="color:#994500;">command</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;pull&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">dir</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;@{dest}&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/sequential&gt;</span><br />
<span style="color:#881280;">&lt;/macrodef&gt;</span></div>

<p>The first one, &#8220;git&#8221; just runs git with whatever command you provide to it (clone, pull, etc) along with any arguments you pass to it. Clone:</p>

<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#881280;">&lt;git </span><span style="color:#994500;">command</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;clone&quot;</span><span style="color:#881280;">&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;args&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;arg </span><span style="color:#994500;">value</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;git://github.com/280north/ojunit.git&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;arg </span><span style="color:#994500;">value</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;ojunit&quot;</span><span style="color:#881280;"> /&gt;</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#881280;">&lt;/args&gt;</span><br />
<span style="color:#881280;">&lt;/git&gt;</span><br />
</div>

<p>And pull:</p>

<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#881280;">&lt;git </span><span style="color:#994500;">command</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;pull&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">dir</span><span style="color:#881280;"> = </span><span style="color:#1a1aa6;">&quot;repository_path&quot;</span><span style="color:#881280;"> /&gt;</span></div>

<p>(Other git command will likely work, these are just the ones I needed)</p>

<p>The second one, &#8220;git-clone-pull&#8221; uses the first one to clone a repository then pull from it. This effectively clones the repository if it hasn&#8217;t already been cloned, otherwise it pulls. However, since ant is fairly limited in what sorts of conditional execution you can perform, it just does both (clone will fail if it&#8217;s already been cloned, and pull will always be executed, even immediately after a the initial clone). Obviously not ideal, but it works, and I couldn&#8217;t figure out a better way without writing actual code.</p>

<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#881280;">&lt;git-clone-pull </span><span style="color:#994500;">repository</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;git://github.com/280north/ojunit.git&quot;</span><span style="color:#881280;"> </span><span style="color:#994500;">dest</span><span style="color:#881280;">=</span><span style="color:#1a1aa6;">&quot;ojunit&quot;</span><span style="color:#881280;"> /&gt;</span></div>

<p>There is plenty of room for improvement, but I suspect a proper Ant task written in Java is the right way to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://tlrobinson.net/blog/2008/11/13/ant-tasks-for-git/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>git bisect run</title>
		<link>http://tlrobinson.net/blog/2008/10/01/git-bisect-run/</link>
		<comments>http://tlrobinson.net/blog/2008/10/01/git-bisect-run/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 10:03:45 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://tlrobinson.net/blog/?p=51</guid>
		<description><![CDATA[This feature of git is too cool not to blog about: git bisect, and more specifically, git bisect run.

&#8220;git bisect&#8221; is a tool that facilitates a binary search of changes to your git repository to help find where a bug was introduced. You can walk through the process manually using &#8220;git bisect {good,bad,skip}&#8220;, or if [...]]]></description>
			<content:encoded><![CDATA[<p>This feature of git is too cool not to blog about: <a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html"><strong>git bisect</strong></a>, and more specifically, <strong>git bisect run</strong>.</p>

<p>&#8220;git bisect&#8221; is a tool that facilitates a binary search of changes to your git repository to help find where a bug was introduced. You can walk through the process manually using &#8220;git bisect <em>{good,bad,skip}</em>&#8220;, or if you can write a script that automates checking for the bug, you can use &#8220;git bisect run <em>scriptname</em>&#8221; to have git do all the work for you.</p>

<p>The script should return 0 if the bug does not exist, and some other number (except 125) if the bug does exist.</p>

<p>In my case, <a href="http://cappuccino.org">Cappuccino&#8217;s</a> &#8220;steam&#8221; build tool was failing, so I wrote a simple script that would test it by trying to run &#8220;steam&#8221; on Foundation:</p>

<div style="text-align:left;color:#000000; background-color:#ffffff; border:solid black 1px; padding:0.5em 1em 0.5em 1em; overflow:auto;font-size:small; font-family:monospace; "><span style="color:#236e25;">#!/bin/sh<br />
</span><br />
<span style="color:#236e25;"># install a known working copy of the build tools<br />
</span><span style="color:#440088;">pushd</span> ../tmp/Tools<br />
<span style="color:#880088;">sudo</span> <span style="color:#880088;">sh</span> <span style="color:#880088;">install</span>-tools<br />
<span style="color:#440088;">popd</span><br />
<br />
<span style="color:#236e25;"># build whatever version of Cappuccino git bisect has checked out for us<br />
</span><span style="color:#880088;">rm</span> -rf <span style="color:#c4620a;">$STEAM_BUILD</span><br />
ant release<br />
<br />
<span style="color:#236e25;"># install the freshly built tools<br />
</span><span style="color:#440088;">pushd</span> <span style="color:#c4620a;">$STEAM_BUILD</span>/Cappuccino/Tools<br />
<span style="color:#880088;">sudo</span> <span style="color:#880088;">sh</span> <span style="color:#880088;">install</span>-tools<br />
<span style="color:#440088;">popd</span><br />
<br />
<span style="color:#236e25;"># run steam on Foundation to see if the built tools work<br />
</span><span style="color:#880088;">rm</span> -rf <span style="color:#c4620a;">$STEAM_BUILD</span><br />
<span style="color:#440088;">pushd</span> Foundation<br />
steam<br />
RETURN=$?<br />
<span style="color:#440088;">popd</span><br />
<br />
<span style="color:#236e25;"># return the recorded return value<br />
</span><span style="color:#440088;">exit</span> <span style="color:#c4620a;">$RETURN</span><br />
</div>

<p>I provided &#8220;git bisect start&#8221; with a known bad commit and a known good commit, then ran &#8220;git bisect run&#8221;:</p>

<p><pre><code>git bisect start c1e882ace1dd29aea98d9247db304fe5d5077df7 d6c0f8802a2fd3a07e14418de7744ae04ae4499e
git bisect run ../test.sh</code></pre></p>

<p>Sure enough, a few minutes later &#8220;git bisect&#8221; reported exactly which commit caused the problem:</p>

<p><pre><code>01177a7e0237b1bd026cf0c4ca923fced8536772 is first bad commit
commit 01177a7e0237b1bd026cf0c4ca923fced8536772
Author: name removed to protect the not-so-innocent</p>

<p>Date:   Tue Sep 30 17:29:56 2008 -0700</p>

<p>Fix keys conflict in CPDictionary</p>

<p>[#77 state:resolved]</p>

<p>:040000 040000 bf4ceafbf439aa54790fc57a2a78dec8283abadf b269f85f3f4ed4d08e4c8261ee409e9d88255b1d M    AppKit
:040000 040000 f9c1fdb3c02c7c899285c8cb8123b29e99a17e46 48cc5aefde707119fe956dd882dcd8f8182e7012 M    Foundation
:040000 040000 b780743d17ddb0ebda188703725e9dabf23fd458 c72750dabd99ca42d9144f3074c68c42b727d028 M    Objective-J
bisect run success</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://tlrobinson.net/blog/2008/10/01/git-bisect-run/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
