<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Hg on Games From Within</title><link>https://gamesfromwithin.com/tag/hg/</link><description>Recent content in Hg on Games From Within</description><generator>Hugo</generator><language>en-us</language><copyright>2004–2026 Noel Llopis</copyright><lastBuildDate>Thu, 02 Sep 2010 00:00:00 +0000</lastBuildDate><atom:link href="https://gamesfromwithin.com/tag/hg/index.xml" rel="self" type="application/rss+xml"/><item><title>Reconsidering Version Control</title><link>https://gamesfromwithin.com/reconsidering-version-control/</link><pubDate>Thu, 02 Sep 2010 00:00:00 +0000</pubDate><guid>https://gamesfromwithin.com/reconsidering-version-control/</guid><description>&lt;p&gt;Ever since I turned indie, version control just hasn&amp;rsquo;t been much of an issue. Gone are the days of hundreds of multi-GB files that changed multiple times per day. With small teams of one or two plus a few collaborators, Subversion hosted remotely worked fine. Of course, all the cool kids these days are going on about how their distributed version control systems solve world hunger, but I&amp;rsquo;ve been mostly ignoring it because I have better things to do with my time (like writing games &lt;a href="#1"&gt;[1]&lt;/a&gt;).&lt;/p&gt;</description><content:encoded><![CDATA[<p>Ever since I turned indie, version control just hasn&rsquo;t been much of an issue. Gone are the days of hundreds of multi-GB files that changed multiple times per day. With small teams of one or two plus a few collaborators, Subversion hosted remotely worked fine. Of course, all the cool kids these days are going on about how their distributed version control systems solve world hunger, but I&rsquo;ve been mostly ignoring it because I have better things to do with my time (like writing games <a href="#1">[1]</a>).</p>
<p>Yesterday things changed a bit. As a result of <a href="/growing-indie-style/">last week&rsquo;s &ldquo;growing&rdquo; post</a>, <a href="http://twitter.com/mrfreire">Manuel Freire</a> is going to join me to help with <a href="http://www.snappytouch.com/flowergarden">Flower Garden</a> development. That makes two of us banging on the same codebase, and from two different time zones, so we don&rsquo;t get the benefit of being in the same closet as it was the case with <a href="/tag/power-of-two/">Power of Two Games</a>. Since I was in my get-things-done mindset, I figured I would just set up a new svn repository for the project, move over the Flower Garden data, give us both access to it, and move on.</p>
<p>But no, it couldn&rsquo;t be that easy. Can you guess what the first words out of his mouth were when I asked him about version control? &ldquo;Oh, I love Git!&rdquo;</p>
<p>That was the last straw. I had to do a mini-research session on version control systems, so I spent a couple of hours looking into it. If we were going to move over to something, now would be the time to do it.</p>
<h3 id="git-and-mercurial">Git and Mercurial</h3>
<p>Git and Mercurial both look great. I was debating which one to go with until I realized that they&rsquo;re both two flavors of the same thing, so it comes down more to personal preferences and tastes. <a href="http://importantshock.wordpress.com/2008/08/07/git-vs-mercurial/">This is best description</a> I found on the differences between Git and Mercurial. When it comes to computers, I&rsquo;m totally a MacGyver guy (actually, that might be true when it comes to anything now that I think about it), so that made my decision easier.</p>
<p>The big feature everybody keeps talking about for distributed version systems is effortless branching. That&rsquo;s great, but I really have no intention of branching much. I haven&rsquo;t created a single branch in the last four years, and I don&rsquo;t expect to start doing that now. Next.</p>
<p>The other big feature is working disconnected from the network. That&rsquo;s something I could use, but considering I&rsquo;m only offline a handful of times a year, it really isn&rsquo;t enough of an incentive to switch to a whole new system.</p>
<p>Git sounds like a great tool for large, distributed, open-source projects with hundreds of contributors, but frankly, I couldn&rsquo;t find anything else that was worth mentioning for a small project and a handful of people. I feel like someone is trying to sell me a Porsche when my beat-up Hyundai is still perfectly functional for driving to the grocery store once a week. Am I missing something obvious?</p>
<h3 id="hosting">Hosting</h3>
<p>Hosting the actual repository was part of the consideration. This is for a private project, so all open-source sites are out. Ideally I wanted to host it just like I do with Subversion in Dreamhost, but the instruction page on how to install <a href="http://wiki.dreamhost.com/Git">Git</a> and <a href="http://wiki.dreamhost.com/Mercurial">Mercurial</a> are enough to put most people off. Clearly, there&rsquo;s a steep learning curve there.</p>
<p><img alt="server-rack.jpg" loading="lazy" src="/reconsidering-version-control/images/server-rack.jpg">So <a href="http://twitter.com/SnappyTouch/status/22671257092">I asked on Twitter for recommendations</a>. I&rsquo;ve learned that Git and Mercurial users are definitely very vocal and are always willing to help someone join their ranks. Within minutes I had all the suggestions listed below:</p>
<ul>
<li><a href="http://github.com/">Github</a> (Git)</li>
<li><a href="http://repositoryhosting.com/">Repositoryhosting.com</a> (Git, Hg, SVN)</li>
<li><a href="http://bitbucket.org/">Bitbucket</a> (Hg)</li>
<li><a href="http://www.fogcreek.com/kiln/">Klin</a> (Hg)</li>
<li><a href="http://codaset.com/">CodaSet</a> (Git)</li>
<li><a href="http://www.assembla.com/">Assembla</a> (Git, SVN)</li>
<li><a href="http://unfuddle.com/">Unfuddle</a> (Git, SVN)</li>
<li><a href="http://beanstalkapp.com/">Beanstalkapp.com</a> (Git, SVN)</li>
<li><a href="http://sourcerepo.com/">SourceRepo</a> (Git, Hg, SVN)</li>
<li><a href="https://www.dropbox.com/home">Plain Dropbox</a> (Git I guess)</li>
<li>Self-hosting (<a href="http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way">gitosis</a> for managing Git)</li>
</ul>
<p>Prices varied a lot. From the $25/month/user of Kiln, to the $6/month of RepositoryHosting (gets you unlimited users and 2GB of storage). The Snappy Touch repository is already over 2GB, so it would end up being a bit more expensive than that, but not too bad.</p>
<p>Of those, Github was definitely the most recommended. I was starting to feel Git might not be the one for me, so I looked a bit more into RepositoryHosting because they had Subversion support. It turns out they also provide Trac, which is a great tool, although <a href="/indie-project-management-for-one-tools/">I already have that set up myself</a>.</p>
<h3 id="wish-list">Wish List</h3>
<p><strong>Binary files</strong></p>
<p>The one thing I really want in a version control system is good large binary file handling. I check in everything under version control, source code, assets, raw assets, and even built executables for each version. I want to be able to throw multiple GB psd files in the repository and have it work correctly (meaning fast, and using the least amount of space possible).</p>
<p><a href="http://www.perforce.com/">Perforce</a> did an OK job with that. Git and Mercurial apparently are both horrible at it. So is Subversion, but at least it&rsquo;s a tool I already know and I don&rsquo;t have to spend time learning the ins and outs of how to optimize the Git database or how to make backups, or cull unused trees.</p>
<p><strong>GUI</strong></p>
<p>I love my command-line tools. I live in Terminal for a good part of the day, and having a real shell is one of the things that makes my life so much more pleasant under Mac OS than under Windows. But there are some things for which a GUI tool is a really useful addition, and version control is one of them.</p>
<p>On the Mac, I&rsquo;ve been using <a href="http://versionsapp.com/">Versions</a> as a client for Subversion and it does everything I want. It&rsquo;s fast, handles multiple repositories, lets me browse history, diff changes, etc. From my brief search and other people&rsquo;s comments, there&rsquo;s nothing quite like that for Git or Mercurial yet. That&rsquo;s a pretty big, gaping hole.</p>
<p><strong>Low-level access</strong></p>
<p>Looking at all those hosting providers, I realized how much I want to have low-level access to the database. I want to be able to back it up myself, and run svnadmin when I want to. A lot of those hosting sites looked really pretty, but you were very limited in what you could do.</p>
<h3 id="coming-to-a-decision">Coming To A Decision</h3>
<p>If this were a thriller, you&rsquo;d be disappointed. I&rsquo;m afraid there are no plot twists and you can already guess the conclusion.</p>
<p>In the end, since neither Git nor Hg are built to address my biggest need (large binary files), I&rsquo;ll stick with svn. It might be old, it might not be cool, but it serves my needs, I already know how to use it, I have the tools, I can admin it and fix a problem. I can concentrate on what matters instead: Writing games.</p>
<p>I decided to continue hosting it myself on Dreamhost. I can easily have one repository for every major project. However, by default, Dreamhost creates svn repositories using htaccess security and HTTP protocol. That&rsquo;s OK, except that none of the actual data is encrypted as it would be if I were using ssh. I could use HTTPS, but then I would have to set up a certificate and pay for a fixed IP address, so instead I found an alternate way to have a secure connection.</p>
<p>All Subversion repositories live in a user account (svnuser). I create a new user group for every repository, and change all the files in the repository to belong to that group. Make sure you also set the <a href="http://tldp.org/LDP/intro-linux/html/sect_04_01.html#sect_04_01_06">SGID bit</a> so any files created in that directory still belong to the group. Then I can create a new shell user for every collaborator, and add him to the groups of the repositories I&rsquo;d like him to have access to. At that point, he&rsquo;ll be able to access the repository as svh+ssh://username@hostname.com/home/svnuser/repository. All safe and secure.</p>
<h3 id="bonus-svn-fu">Bonus SVN-Fu</h3>
<p>Here&rsquo;s something that I learned yesterday while I was moving repositories around. It&rsquo;s probably common knowledge for seasoned SVN admins, but it was new to me.</p>
<p>I had a repository that included a bunch of my projects. What I wanted was to create a new repository that still had all the history, but only for the FlowerGarden part of the tree. I knew about svnadmin dump for transferring whole repositories, but I didn&rsquo;t know there was a very simple way to <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.filtering">only transfer part of it</a>.</p>
<p>First you need to dump it as usual:</p>
<pre tabindex="0"><code>svnadmin dump repository &gt; repos-dumpfile
</code></pre><p>Now, it turns out you can process the dump file before adding it back to another repository. So we can do:</p>
<pre tabindex="0"><code>svndumpfilter include FlowerGarden --drop-empty-revs --renumber-revs &lt; repos-dumpfile &gt; fg-dumpfile
</code></pre><p>Finally, you can add the resulting dump file into a fresh repository and have all the history for that project and only that project:</p>
<pre tabindex="0"><code>svnadmin create flowergarden
svnadmin load --ignore-uuid flowergarden &lt; fg-dumpfile
</code></pre><p>Amazingly, for a repository that was over 2GB, that only took a few minutes. Go Subversion!</p>
<p>[1] Or reading. Or going for a walk. Heck, even sleeping would be a better use of my time than futzing around with a new tool.[2]</p>
<p>[2] And yes, I realize I sound like a grumpy old man. Getting there apparently. Now get off my lawn.</p>
<p><em>This post is part of <a href="http://idevblogaday.com/">iDevBlogADay</a>, a group of indie iPhone development blogs featuring two posts per day. You can keep up with iDevBlogADay through the <a href="http://idevblogaday.com/">web site</a>, <a href="http://feeds.feedburner.com/idevblogaday">RSS feed</a>, or <a href="http://twitter.com/#search?q=%23idevblogaday">Twitter</a>.</em></p>
]]></content:encoded></item></channel></rss>