<?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>Ramblings of a Geek - Jeremy Johnstone &#187; git</title>
	<atom:link href="http://www.jeremyjohnstone.com/tag/git/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jeremyjohnstone.com</link>
	<description>Ramblings of a Geek</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:33:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using git-svn with non-standard subversion repository layouts</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html#comments</comments>
		<pubDate>Thu, 14 Jan 2010 07:01:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[stdlayout]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1508</guid>
		<description><![CDATA[Today while working with a 3rd party&#8217;s codebase, I ran into a situation which git-svn could not directly handle without pulling in massive amounts of unnecessary repository history. Turns out the solution was much simpler than I anticipated, so I&#8217;m sharing here in case it&#8217;s useful for somebody else. The repository was as follows:

http://svn.domain.org/svn/trunk/&#60;project_name&#62; -- [...]]]></description>
			<content:encoded><![CDATA[<p>Today while working with a 3rd party&#8217;s codebase, I ran into a situation which git-svn could not directly handle without pulling in massive amounts of unnecessary repository history. Turns out the solution was much simpler than I anticipated, so I&#8217;m sharing here in case it&#8217;s useful for somebody else. The repository was as follows:</p>
<pre>
http://svn.domain.org/svn/trunk/&lt;project_name&gt; -- Production branch
http://svn.domain.org/svn/branches/&lt;project_name&gt; -- Development branch
</pre>
<p><br/></p>
<p>I tried a number of approaches. First off, using the normal &#8211;stdlayout option with http://svn.domain.org/svn repository root to git-svn clone would have pulled in thousands of changesets from the repository which had nothing to do with the project I was working on.</p>
<p>Next I tried to use &#8211;trunk=trunk/&lt;project_name&gt; and &#8211;branches=branches/&lt;project_name&gt; and unfortunately this method tried to create a new branch for every child directory of branches/&lt;project_name&gt;. Obviously this wasn&#8217;t what I wanted either.</p>
<p>After doing a bit of searching on the web, I stumbled across another solution via <a title="Multiple branches using git-svn" href="http://www.dmo.ca/blog/20070608113513/" target="_blank">this blog</a>. Basically what it suggests doing is to use a separate svn-remote for the alternative path. This conveniently works around the issue quite nicely without any side-effects I&#8217;ve run into so far. Here&#8217;s the steps I followed:</p>
<ol>
<li>git svn clone http://svn.domain.org/svn/ &#8211;trunk=trunk/&lt;project_name&gt; &lt;project_name&gt;</li>
<li>cd &lt;project_name&gt;</li>
<li>vim .git/config</li>
<li>Add an additional remote as follows:<br/>
<pre>[svn-remote "svndev"]<br/>url = http://svn.domain.org/svn/<br/>fetch = branches/&lt;project_name&gt;:refs/remotes/dev</pre>
</li>
<li>git svn fetch svndev</li>
<li>git checkout -b dev remotes/dev</li>
</ol>
<p>After following those steps, you now have a new remote &#8216;remotes/dev&#8217; which is a copy of the dev environment branch from the repository and a new local branch called &#8220;dev&#8221;. You should now be able to proceed like normal using your usual git-svn workflow.</p>
<p>Of course the obvious answer would be to use standard repository layouts or to not use Subversion and/or git-svn, but sometimes that&#8217;s not always an option. I hope this helps someone stuck in a similar situation. Also, please be sure and sound off in the comments if you find an alternative solution!</p>
<p>Update:<br />
Here are a <a href="http://kerneltrap.org/mailarchive/git/2008/6/26/2241084" target="_blank" title="git mailing list">couple</a> <a href="http://kerneltrap.org/mailarchive/git/2008/6/26/2241154" target="_blank" title="git mailing list">additional</a> <a href="http://kerneltrap.org/mailarchive/git/2008/6/27/2243984" target="_blank" title="git mailing list">links</a> which might prove useful depending on your desired workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP parser for OS X plist XML files</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-10-26-php-parser-for-os-x-plist-xml-files.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-10-26-php-parser-for-os-x-plist-xml-files.html#comments</comments>
		<pubDate>Mon, 27 Oct 2008 03:42:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php_class_lib]]></category>
		<category><![CDATA[plist]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=384</guid>
		<description><![CDATA[Digging around today for a PHP parser for OSX plist files, I was surprised to find no good pre-existing solutions. Even Apple&#8217;s own site gives a relatively poor solution to the problem (see here). Normally SimpleXML is enough to handle most XML parsing needs, but the plist XML format is just broken enough to make [...]]]></description>
			<content:encoded><![CDATA[<p>Digging around today for a PHP parser for OSX plist files, I was surprised to find no good pre-existing solutions. Even Apple&#8217;s own site gives a relatively poor solution to the problem (<a href="http://developer.apple.com/internet/opensource/php.html">see here</a>). Normally SimpleXML is enough to handle most XML parsing needs, but the plist XML format is just broken enough to make parsing it with SimpleXML virtually impossible. Since I hadn&#8217;t played with XMLReader much, I thought it would be a good chance to give it a spin. For the anxious types, the code is available on <a href="http://github.com/jsjohnst/php_class_lib/tree/master">github in my php_class_lib project</a>, so dig right in. Read on for a simple example (included in the repos).</p>
<p>The original intent of the parser for me was to parse my iTunes&#8217; library in PHP, so <a href="http://github.com/jsjohnst/php_class_lib/tree/master/classes/parsers/plist/example.php">this example</a> will show doing just that:</p>
<pre class="brush: php">&lt;?php

include("PlistParser.inc");

$parser = new plistParser();
$plist = $parser-&gt;parse(dirname(__FILE__) . "/iTunes.xml");
var_dump($plist);
</pre>
<p>And from that, the output is as follows:</p>
<pre class="brush: php">array(8) {
  ["Major Version"]=&gt;
  int(1)
  ["Minor Version"]=&gt;
  int(1)
  ["Application Version"]=&gt;
  string(5) "8.0.1"
  ["Features"]=&gt;
  int(5)
  ["Show Content Ratings"]=&gt;
  bool(true)
  ["Music Folder"]=&gt;
  string(60) "file://localhost/Users/testUser/Music/iTunes/iTunes%20Music/"
  ["Library Persistent ID"]=&gt;
  string(15) "C39203948AF3D3E"
  ["Tracks"]=&gt;
  array(1) {
    [1]=&gt;
    array(25) {
      ["Track ID"]=&gt;
      int(1)
      ["Name"]=&gt;
      string(8) "My Track"
      ["Artist"]=&gt;
      string(9) "My Artist"
      ["Album"]=&gt;
      string(8) "My Album"
      ["Genre"]=&gt;
      string(8) "My Genre"
      ["Kind"]=&gt;
      string(15) "MPEG audio file"
      ["Size"]=&gt;
      int(123456)
      ["Total Time"]=&gt;
      int(123456)
      ["Track Number"]=&gt;
      int(1)
      ["Year"]=&gt;
      int(2008)
      ["Date Modified"]=&gt;
      string(20) "2008-03-03T03:33:33Z"
      ["Date Added"]=&gt;
      string(20) "2008-03-03T03:33:33Z"
      ["Bit Rate"]=&gt;
      int(128)
      ["Sample Rate"]=&gt;
      int(44100)
      ["Comments"]=&gt;
      string(20) "All Rights Reserved."
      ["Release Date"]=&gt;
      string(20) "2007-03-12T04:01:37Z"
      ["Persistent ID"]=&gt;
      string(14) "C3E339393939E3"
      ["Track Type"]=&gt;
      string(4) "File"
      ["Podcast"]=&gt;
      bool(false)
      ["Unplayed"]=&gt;
      bool(true)
      ["File Type"]=&gt;
      int(123456)
      ["File Creator"]=&gt;
      int(123456)
      ["Location"]=&gt;
      string(66) "file://localhost/Users/testUser/Music/iTunes/iTunes%20Music/my.mp3"
      ["File Folder Count"]=&gt;
      int(4)
      ["Library Folder Count"]=&gt;
      int(1)
    }
  }
}</pre>
<p>As you can see, the PHP parser made short order of that task. From here you now have full access to all the metadata in your iTunes library. Feel free to use the class in your own projects and be sure to let me know what you build with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-10-26-php-parser-for-os-x-plist-xml-files.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
