<?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>Made of Bugs &#187; subversion</title>
	<atom:link href="http://blog.nelhage.com/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nelhage.com</link>
	<description>It's software. It's made of bugs.</description>
	<lastBuildDate>Thu, 18 Aug 2011 21:57:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>On git and usability</title>
		<link>http://blog.nelhage.com/2010/01/on-git-and-usability/</link>
		<comments>http://blog.nelhage.com/2010/01/on-git-and-usability/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 04:57:31 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://blog.nelhage.com/?p=64</guid>
		<description><![CDATA[I&#8217;ve been helping a number of people get started working with git over the last couple of weeks, as Ksplice has brought on some new interns, and we&#8217;ve had to get them up to speed on our internal git repositories. (As you might expect from a bunch of kernel hackers, we use git for absolutely [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been helping a number of people get started working with <code>git</code>
over the last couple of weeks, as <a href="http://ksplice.com/">Ksplice</a> has
brought on some new interns, and we&#8217;ve had to get them up to speed on
our internal git repositories. (As you might expect from a bunch of
kernel hackers, we use git for absolutely everything). While that
experience is what prompted this post, it wasn&#8217;t really anything I
haven&#8217;t seen before as <a href="http://sipb.mit.edu">SIPB</a> transitioned from a
group that mostly versioned code in SVN or
<a href="http://svk.bestpractical.com/">SVK</a> to one that used git almost
exclusively, practically overnight, as these things go.</p>

<p>I love git, and use it everywhere. One of the things I particularly
love about git is the fact that I understand essentially every element
of git&#8217;s data model and how it works, which means that I can invent
odd workflows or script git to do things that I never could have with
SVN or even SVK. Part of the reason for this is that git, internally,
really is fundamentally simple in a way subversion isn&#8217;t. There&#8217;s some
complexity (which I don&#8217;t and don&#8217;t have to understand) behind
implementing its model efficiently, but I can describe the basic git
data model in about a single slide (And in fact <a href="http://web.mit.edu/nelhage/Public/git-slides-2009.pdf">I have</a>).</p>

<p>At the same time, though, I consistently find that people who come to
git from subversion find it insufferably complex and hard to learn,
and spend quite a while wrangling with it, before they eventually
fight it to a draw where they only need to ask their local git expert
to dig them out of a hole every once in a while, or else until they
just give up and declare git to be space-alien and go back to
something they &#8220;understand&#8221;.</p>

<h2>The problem</h2>

<p>Having helped enough of these people, I&#8217;ve begun to understand the
problem. Fundamentally, the way (most) people learn and think about
subversion is different from the way git experts think about
git. subversion&#8217;s internal model is fairly complex, but <strong>you are not
expected to understand it</strong>. You just have to know the half dozen
commands you&#8217;ll ever need, and you use them, and everything is fine.</p>

<p>Git&#8217;s model is fundamentally fairly simple (a DAG of immutable commit
objects where branches are named mutable pointers into it), but <strong>you
are expected to understand it fully</strong> to use git effectively.</p>

<p>A subversion user who wants to get the latest updates from the server
just knows to run <code>svn up</code> and go back to their life. A git user has
to (in general) think about whether they want to rebase their local
changes onto the remote changes or merge them, and which remote branch
they want (this is all, of course, expressed essentially in terms of
the git data model), and then maps that back into the commands they
want to perform this task.</p>

<p>Subversion users aren&#8217;t used to thinking like this, and so when they
ask a git user for help, they get one of two classes of answers,
neither of which they like. Either they just get back a list of half a
dozen possible commands they could choose (since the git user has
mapped their request into the git object model, and can think of a
bunch of ways to implement that operation, depending on your mood and
the phase of the moon), or else they get a &#8220;What are you really trying
to?&#8221;, since their request has multiple interpretations in the language
of git objects. Neither answer is a single command that will always
solve their problem, which is what they want, so they can just go back to whatever they were trying to do, and so they end concluding that git is needlessly strange and confusing.</p>

<p>I think there are at least two reasons for this different perspective
from git users. One is historical &#8212; git was designed to work this
way. Linus wrote git as a dumb content tracker, and intended other
people to write various UIs on top of it, but not really for anyone to
use it as-is. So fundamentally, git is designed to just implement this
basic model, and not to export a single way to do anything.  The
other, perhaps more fundamental reason, is that git is designed to be
infinitely flexible, and so it&#8217;s fairly rare that you <em>can</em> give an
answer for &#8220;How do I do X with git?&#8221;, since the answer will often
depend on, &#8220;Well, what are your project&#8217;s conventions?&#8221;</p>

<h2>What do we do about this?</h2>

<p>So, as git users, hackers, and evangelists, what can we do to improve
this situation? I think that basically, we need to understand what&#8217;s
going on here, and try to have better answers for what the subversion
users regard as simple questions. We should encourage people to get to
know and love the git object model, but realize that most of the time,
they just want to get work done, and we need to try to have simple
answers to simple questions.</p>

<p>To that end, I think there are three main remaining areas in the git UI
that I think new users find confusing, and that we need to figure out
how to improve. These are pulling and pushing changes, and the whole
issue of the git index. Here are my thoughts on what&#8217;s wrong, and what
we can improve on:</p>

<ul>
<li><p>&#8221;git-push&#8221;: This command is a disaster in a number of
ways. <code>matching</code> is utterly the wrong default for <code>push.default</code> (I
believe 1.7 is going to fix this). The <code>git push $REMOTE $BRANCH</code>
syntax is not optimized for the common &#8220;subversion-like&#8221; case of a
single remote, and leads countless users to attempt to <code>git push
master</code>, at which point they get the less than totally helpful
error message:</p>

<pre><code>fatal: 'master' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
</code></pre>

<p>In general, the error messages are pretty bad. I believe it was
<a href="http://twitter.com/defunkt"><code>@defunkt</code></a> who nominated &#8220;src refspec
does not match any&#8221; as the &#8220;worst error message of all time&#8221;, and
it&#8217;s hard not to see his point.</p></li>
<li><p>&#8221;git-pull&#8221; is also problematic. The vast majority of users in a
project live at the edges, pushing code inwards, and they almost
never actually want to create a merge commit. I almost always end up
telling users &#8220;No, really, you always just want <code>pull --rebase</code>&#8220;,
which leaves them with a poor impression of git&#8217;s UI (if you always
want that flag, why isn&#8217;t it just mandatory?), and which is hard to
explain, because the whole concept of &#8220;rebasing&#8221; is difficult to
really grok without really understanding the commit DAG.</p>

<p><code>branch.&lt;name&gt;.rebase</code> and <code>branch.autosetuprebase</code> are a partial solution, but is there a reason I can&#8217;t just have a repository wide default option that makes <code>--rebase</code> the default? With the former solution, I&#8217;m never confident I&#8217;ve actually set it on all of my branches, or that it will get set if some script creates a branch without using <code>git-branch</code> or <code>git-checkout</code>.</p>

<p>Similarly, it sucks that you can&#8217;t pull if you have any uncommitted
changes at all, especially for subversion users who are used to this
Just Working.</p></li>
<li><p>Finally, we really need to improve the story with the index. As an
experienced git user, I love the index, and use it for many reasons
all the time. However, as anyone who has tried to explain it (or
even to learn git) probably knows, it&#8217;s a confusing idea at first.</p>

<p>Generally, when someone is starting out with git, I try to ignore
the index, and suggest they just always use <code>git commit</code> with a
path. I then have to handwave, of course, over why they need <code>git
commit -a</code> instead of <code>git commit</code>, but that&#8217;s a mostly minor
problem.</p>

<p>The bigger issue comes when a user finds themselves in a merge
conflict, and finds that it&#8217;s basically impossible to do anything
without fully understanding the index, and all of the weird commands
for moving content between the index, the working tree, and
<code>HEAD</code>. Just the other day, three of us git experts had to stop and
think for a while about how to answer the question &#8220;So, if I&#8217;m in a
conflicted merge, and I want to just conditionally take “their”
changes, what the hell do I do?&#8221;. That&#8217;s not a good sign for new
users being able to figure out what to do here.</p>

<p>I don&#8217;t fully know what the right answer is, but I think it&#8217;s clear
the tools need some help here.</p></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/2010/01/on-git-and-usability/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

