<?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>Intrepid Blog &#187; git</title>
	<atom:link href="http://blog.affien.com/archives/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 01 Mar 2010 00:58:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>git&#8217;s versus svn&#8217;s storage efficiency</title>
		<link>http://blog.affien.com/archives/2008/07/08/gits-versus-svns-storage-efficiency/</link>
		<comments>http://blog.affien.com/archives/2008/07/08/gits-versus-svns-storage-efficiency/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 00:43:47 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[codeyard]]></category>
		<category><![CDATA[cyv]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/?p=319</guid>
		<description><![CDATA[At Codeyard we maintain a git and a subversion repository (which are synced with each other) for each of the >115 projects. The following graph shows the repositories plotted logarithmically according to the size of their whole server side subversion repository horizontally and their git repository size vertically:

To make more sense of the logarithmic nature [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://codeyard.net/">Codeyard</a> we maintain a git and a subversion repository (which <a href="http://blog.w-nz.com/archives/2008/05/26/cyv-syncing-git-and-svn/">are synced</a> with each other) for each of the >115 projects. The following graph shows the repositories plotted logarithmically according to the size of their whole server side subversion repository horizontally and their git repository size vertically:<br />
<a href='http://blog.w-nz.com/wp-content/uploads/2008/07/git-vs-svn.png'><img src="http://blog.w-nz.com/wp-content/uploads/2008/07/git-vs-svn.png" alt="" title="Git versus SVN storage efficiency" width="428" height="285" class="aligncenter size-full wp-image-320" /></a></p>
<p>To make more sense of the logarithmic nature of the graph, I&#8217;ve added three lines.  The first (solid black) indicates the points of which both sizes are equal.  The second course dashed line indicates the points of which the subversion repository is twice as large as the git repository.  And lastly, the third finely dashed line indicates the points of which the subversion repository is five times as large as the git repository.</p>
<p>All projects for which git is less storage efficient, are smaller than 100Kb.  The projects for which git is most storage efficient (up to even 6 times for a certain C# project), are all of medium size (10&#8211;100MB) and code-heavy.  For the other projects, which are blob heavy (eg. images), git and subversion are close (git beats svn by ~20%).</p>
<p>One notable disadvantage of <em>huge</em> (someone committed a livecd image) git repositories, is an apparent <img src='/wp-latexrender/pictures/f3bca1459595f95e1a28e1176fe9343f.png' title='\geq2N' alt='\geq2N' align=absmiddle> memory usage of <code>git repack</code> even if I tell it not to with <code>--window-memory</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2008/07/08/gits-versus-svns-storage-efficiency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cyv: syncing git and svn</title>
		<link>http://blog.affien.com/archives/2008/05/26/cyv-syncing-git-and-svn/</link>
		<comments>http://blog.affien.com/archives/2008/05/26/cyv-syncing-git-and-svn/#comments</comments>
		<pubDate>Mon, 26 May 2008 22:16:06 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[codeyard]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[cyv]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/?p=314</guid>
		<description><![CDATA[For codeyard I&#8217;m developing cyv, which is a (still quite specific)  util (written in Python!) to keep svn and git repo&#8217;s in sync.  On the serverside, at least. First, let me explain what exactly is synced.
When someone commits to a svn repo, the git repo is synced with git-svn.  You can just [...]]]></description>
			<content:encoded><![CDATA[<p>For <a href="http://codeyard.nl/">codeyard</a> I&#8217;m developing <a href="http://w-nz.com/gitweb/gitweb.cgi?p=cyv.git;a=summary">cyv</a>, which is a (still quite specific)  util (written in Python!) to keep svn and git repo&#8217;s in sync.  On the serverside, at least. First, let me explain what exactly is synced.</p>
<p>When someone commits to a svn repo, the git repo is synced with <code>git-svn</code>.  You can just clone the git repo and <code>git pull</code> instead of having to use <code>git-svn</code> yourself.</p>
<p>When pushing commits to the git repo on a branch that came from the svn repo, the commits are <code>git-svn dcommit</code>-ed.  If it fails (svn doesn&#8217;t do merges that well), it&#8217;ll revert the updates and will receive the successful part of the dcommit on the next post-commit triggered fetch from the svn repo.  The user will have to <code>git-pull</code> and fix the commits locally: the git manner.</p>
<p>If pushes don&#8217;t involve the svn backed branches, it won&#8217;t have any unusual side-effects. This allows for pushing and pulling of topic-branches separate from svn and pushing them, when mature enough, into subversion without ever having to hassle (as much) with <code>git-svn</code>.</p>
<p>An obvious huge advantage is that a <code>git-clone</code> of the git repo is a hell of a lot faster than a <code>git svn clone</code>.  A second big advantage is that someone can choose to either use git or svn himself while not mutually excluding the other.  This is of special concern to codeyard, where projects should be accessible to everyone: beginners and advanced. If instead we offered fully separated git repositories, the projects that prefer git would become inaccessible for most.  And if we wouldn&#8217;t offer git repos, people would set them up themselves elsewhere, for they really don&#8217;t want to bother themselves with <code>git-svn</code>.</p>
<p><code>cyv</code> contains some neat features.  One I want to highlight is the <code>cyv-layout</code> file, you can place in the root of the svn repo. It tells <code>cyv</code> how the repository is laid out.  Eg:</p>
<blockquote><p><code>trunk:trunk<br />
branches/*: branches/*<br />
tags/*: releases/*<br />
some-git-branch: some/path/in/the/svn/repo</code></p></blockquote>
<p>Another one is a wrapper around <code>git-shell</code> to have per repository permissions for different users depending on their ssh pub key.</p>
<p>To reiterate, <code>cyv</code> is still quite specific to the needs of codeyard.  (If you&#8217;re a codeyard participant: be patient, it&#8217;ll be up mid june). However, if you&#8217;re interested, I&#8217;ll be glad to hear from you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2008/05/26/cyv-syncing-git-and-svn/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upgrading wordpress with git</title>
		<link>http://blog.affien.com/archives/2007/06/07/upgrading-wordpress-with-git/</link>
		<comments>http://blog.affien.com/archives/2007/06/07/upgrading-wordpress-with-git/#comments</comments>
		<pubDate>Thu, 07 Jun 2007 21:03:56 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2007/06/07/upgrading-wordpress-with-git/</guid>
		<description><![CDATA[I didn&#8217;t like upgrading wodpress much. Everytime I did it, I needed to re-apply all my little tweaks to the new wordpress. It took too much time.
I tried to diff -uNr on the current version I was running and the newer version and then applying the resulting diff to the current version, but it seems [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t like upgrading wodpress much. Everytime I did it, I needed to re-apply all my little tweaks to the new wordpress. It took too much time.</p>
<p>I tried to <code>diff -uNr</code> on the current version I was running and the newer version and then applying the resulting diff to the current version, but it seems wordpress has been backporting changes so I got conflicts, quite a lot of them.</p>
<p>Because I was quite tired of porting my changes, I&#8217;ve tried git, the Source Code Managment tool used by the linux kernel, to do it for me:</p>
<p>I did this all in the parent directory of the root of blog.w-nz.com. This folder contains:</p>
<ul>
<li><code>htdocs</code> current installation (2.1.2)</li>
<li><code>2.1.2</code> the unmodified wordpress</li>
<li><code>2.2.0</code> the new wordpress I want to upgrade to</li>
</ul>
<p>First, I created an empty git repository:</p>
<blockquote><p>
<code>mkdir git; cd git; git init-db; cd ..</code>
</p></blockquote>
<p>Then I copied over the unmodified version of wordpress I was running, and commited them:</p>
<blockquote><p><code>cp 2.1.2/* git -R<br />
cd git<br />
git add *<br />
git commit -a -s<br />
cd ..</code></p></blockquote>
<p>Then I copied over my current installation:</p>
<blockquote><p><code>cp htdocs/* git -R<br />
git status # lets see what changed</code></p></blockquote>
<p>There are lots of files like uploads I want git to ignore, so I edit <code>.gitignore</code> to make git ignore them.  There weren&#8217;t any files I added though, otherwise I&#8217;d had to run <code>git add</code> to let git know.</p>
<p>And let commit my changes:</p>
<blockquote><p><code>git commit -a -s</code></p></blockquote>
<p>Now, lets go back to the original commit &#8212; the clean 2.1.2 wordpress &#8212; and start a branch from there:</p>
<blockquote><p><code>git checkout HEAD^ # HEAD^ means parent commit of HEAD: the previous commit<br />
git checkout -b tmp # create a new branch tmp from here</code></p></blockquote>
<p>Now I&#8217;m in a branch without my own changes, which was forked from the master branch.  Lets apply the new wordpress on this branch:</p>
<blockquote><p><code>cd ..<br />
cp 2.2.0/* git -R<br />
cd git<br />
git status # see what changed</code></p></blockquote>
<p><code>git-status</code> showed me that there are a few new files in wordpress 2.2.0, I <code>git-add</code>-ed all of these new files. And then committed  it all:</p>
<blockquote><p><code>git commit -a -s</code></p></blockquote>
<p>Now I&#8217;ve got two branches:</p>
<ul>
<li><code>master</code> which contains wordpress 2.1.2 with my own changes on top as a commit</li>
<li><code>tmp</code> which is forked from the wordpress 2.1.2 from the master branch without my own changes but with the 2.2.0 changes on top</li>
</ul>
<p>What I want to do is to reapply the 2.2.0 changes on top of my current changes&#8217; commit instead of on top of the 2.1.2 commit. To do this, git has a very powerfull util called <code>git-rebase</code>:</p>
<blockquote><p><code>git rebase master</code></p></blockquote>
<p>This will search down the tree until the point where the current branch (tmp) forked from the target branch (master). Then it will re-apply all commits in between on the latest commit of the target branch.</p>
<p>Just like if I&#8217;d use diff/patch I get a merge conflict. <code>git rebase</code> lets me know this and <code>git status</code> shows me which one are these. The one little difference with the diff/patch approach is, that there are way less merge conflicts (git is smarter) and that the merge conflict are way easier to identify and they&#8217;re inline in the original files. Not to mention that when I would have fucked up I&#8217;d always have a way back.</p>
<p>After I fixed the merge conflict, I <code>git update-index</code> each conflicted file (to tell git it&#8217;s resolved) and <code>git rebase --continue</code>-ed.</p>
<p>Now I&#8217;ve got my updated wordpress in the <code>git</code> folder.  Then I backuped the current, copied over from git and visited <code>wp-admin/upgrade.php</code> and I&#8217;m done <img src='http://blog.affien.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>By the way: &#8220;I didn&#8217;t say Subversion doesn&#8217;t work.  Subversion users are just ugly and stupid.&#8221; &#8212; Linus on <a href="http://www.youtube.com/watch?v=4XpnKHJAok8">this Google tech talk</a>.</p>
<p><strong>Sidenote</strong>, I switched from <a href="http://wordpress-plugins.feifei.us/hashcash/">Hashcash</a> to <a href="http://akismet.com/">Akismet</a>. Hashcash didn&#8217;t work anymore and Akismet theoretically should be the best solution because it isn&#8217;t based on security by obscurity. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2007/06/07/upgrading-wordpress-with-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
