threads / discuss / 43475

Re: Cleaning up git user-interface warts

Subject: Re: Cleaning up git user-interface warts

## tl;dr

4 messages between Nov 16, 2006 and Nov 24, 2006.

replies: 3people: 3as markdown or json

Theodore Tso· Nov 16, 2006, 16:07 UTC · lore
On Wed, Nov 15, 2006 at 08:21:36PM -0800, Junio C Hamano wrote:
Show 15 quoted lines
> Theodore Tso <tytso@mit.edu> writes:
> > So with Bitkeeper, with "bk pull" there was never any question about
> > which branch ("line of development") you would be merging into after
> > doing a "bk pull", since there was only one LOD, and given that BK had
> > the rule that a within a LOD only one tip was allowed, a "bk pull"
> > _had_ to do do a merge operation.   
> 
> I've never used Bk and I really appreciate your comments here.
> 
> > If you are operating on your local development branch, the reality is
> > that merging is probably not the right answer in the general case,
> 
> I agree, but I wonder why you are pulling/fetching (with or
> without merge) if you are operating on your local development
> branch (implying that you are in the middle of something else).

Well, when I was using BitKeeper, I never would. Bitkeeper has what Linus calls the broken "repository == branch" model. So normally I would have one repository where I would track the upstream branch, and only do bk pull into that branch. I would do my hacking in another repository (i.e., branch), and periodically keep track wha was going on in mainline by cd'ing to the mainline repository and doing the bk pull there.

The challenge when you put multiple branches into a single repository, is you have to keep track of which branch you happen to be in. In the BK world, this was obvious because it would show up in my shell prompt:

<tytso@candygram> {/usr/src/linux-2.6} 2%

(OK, obviously I'm in the Linux 2.6 upstream repository)

In a system where you need to keep track of what branch you are in via an SCM-specific local state information, it's easy to get confused and do a pull when you are in the "wrong" branch, or while you have local state in your working directory.

What I currently do (and I'm sure I'm being really horrible and need to be say 100 "Hail, Linus"'es for penance for not adhering staying in the one true distributed state of grace) is that I keep an entirely separate Linux 2.6 git repository just to make sure I never get confused about what branch I might happen to be in when I do the "git pull" --- and yeah, I could have used "git fetch", but 3+ years of BK usage plus Hg usage is hard to get away from. I'm sure this is where Linus would say that use of BK and Hg, causes permanent brain damage, ala's Dijkstra's ofted quoted comment about use of Basic inducing brain damage....

Show 7 quoted lines
> I have to disagree with this.  In the simplest CVS-like central
> repository with single branch setup in which many "novice users"
> start out with, there is almost no need for "git fetch" nor
> tracking branch.  You pull, resolve conflicts, attempt to push
> back, perhaps gets "oh, no fast forward somebody pushed first",
> pull again, then push back.  So I am not sure where "you really
> do not want to use pull.  trust me" comes from.

I think the problem is the people who have had years of BK or Hg experience. Maybe it's more of a documentation problem; perhaps a "git for BK" or "git for Hg" users is what's needed. The problem though is that while use of BK is definitely legacy, there are going to be a lot of people who need to use both BK and Hg.

Show 7 quoted lines
> It is a different story for people who _know_ git enough to know
> what is going on.  They may be using multiple branches and
> interacting with multiple remote branches, and there are times
> you would want fetch and there are other times you would want
> pull.  But for them, I do think the suggestion would never end
> with "trust me" -- they would understand what the differences
> are.

Well, I think this is where git's learning curve challenges are. Yes, for users that are doing the stupidest, most simplistic usage models, git is quite easy to use. And I am willing to grant that for people who are using the deepest, most complicated and most distributed development, who understand multiple branches and the index, and all of the deep git plumbing, there's also no problem.

The challenge is in between; to use a car analogy, git has a great automatic transmision, and an extremely powerful "racing clutch". But for someone where the automatic transmission isn't good enough, when as they start to learn how to use the manual transmission, git's extremely touchy "racing clutch" is much more difficult master --- especially in comparison to people who have learned to drive other, more pedestrian "standard transmission" cars. So people who try to use git's racing clutch keep stalling out the car, and some give up in frustration.

And maybe the problem is one that should be addressed only by lots of training, but at the moment, that's the reason why I believe a number of projects have chosen Hg instead of git; they need more than the "stupid simple" git usage, but if they don't need the extreme power of git, Hg is simpler for people to learn how to use. The problem, of course, comes when later on, the project finds out they really want git's power, and now they have to deal with the repository conversion as well as retraining their entire development community.

But hey, maybe this isn't a problem the git community wants to solve; clearly git is optimized for the Linux kernel development, and maybe it's too much to ask that it also work well for somewhat less extremely distributed development models. But in any case, that's why I chose Hg for e2fsprogs. At the time when I made my choice, git was just too painful to learn how to use its more esoteric features, and Hg was much closer to BK's model. (Since then, Hg has added more functionality, including better multiple branches in a repository support, and it's gotten more complicated, but it's still much simper to teach someone how to use Hg than git.)

Regards,
Theodore Tso· Nov 16, 2006, 16:49 UTC · re: Theodore Tso · lore
On Thu, Nov 16, 2006 at 11:07:00AM -0500, Theodore Tso wrote:
Show 5 quoted lines
> I think the problem is the people who have had years of BK or Hg
> experience.  Maybe it's more of a documentation problem; perhaps a
> "git for BK" or "git for Hg" users is what's needed.  The problem
> though is that while use of BK is definitely legacy, there are going
> to be a lot of people who need to use both BK and Hg.   

Err, what I meant to say is that there are going to be a lot of people who will need to simultaneously use both git and Hg.

Sanjoy Mahajan· Nov 22, 2006, 23:21 UTC · re: Theodore Tso · lore
The car analogy is excellently clear.
> they need more than the "stupid simple" git usage, but if they don't
> need the extreme power of git, Hg is simpler for people to learn how
> to use.

As a 80%-hg/20%-git user, I'm curious what features of git you had in mind, so I know where to look as I wander up the git learning curve.

My experience with the git user interface, for what it's worth, is that I never quite get the conceptual model crystal clear enough in my head. So it won't stay for long enough for me to progress up the learning curve and retain the gains. I move up a bit, but the gain soon evaporates and I backslide, and then just hack my way through it.

I found hg's conceptual model very easy to learn, almost as if I don't have to remember anything. Maybe that simplicity comes at a price, whence my question at the start about the extreme-power features of git.

-Sanjoy
`Never underestimate the evil of which men of power are capable.'
Jakub Narebski· Nov 24, 2006, 11:29 UTC · re: Sanjoy Mahajan · lore
Sanjoy Mahajan wrote:
Show 19 quoted lines
> The car analogy is excellently clear.
> 
>> they need more than the "stupid simple" git usage, but if they don't
>> need the extreme power of git, Hg is simpler for people to learn how
>> to use.
> 
> As a 80%-hg/20%-git user, I'm curious what features of git you had in
> mind, so I know where to look as I wander up the git learning curve.
> 
> My experience with the git user interface, for what it's worth, is
> that I never quite get the conceptual model crystal clear enough in my
> head. So it won't stay for long enough for me to progress up the
> learning curve and retain the gains.  I move up a bit, but the gain
> soon evaporates and I backslide, and then just hack my way through it.
> 
> I found hg's conceptual model very easy to learn, almost as if I don't
> have to remember anything.  Maybe that simplicity comes at a price,
> whence my question at the start about the extreme-power features of
> git.

As I never used Mercurial (hg), only read a bit about it and discussed on #revctrl, I cannot say what features git has that hg has not, but I can tell what powerfull git features differ from other SCM.

First, usually in other SCM the concept of branch is closely tied to the concept of repository, perhaps allowing to share storage between branches on the same local filesystem (on the same machine). In git, repository holds DAG, the graph of revisions (of versions). Branches are "only" ways to access this graph, and to extend it of the new commits. This makes git more powerfull, but also perhaps unnecessary complicated if you deal with single-branch repositories, or few-branch case. Additionally this "complication" makes very clean model of repository - but you have to understand it...

Second, the index. One might think that it is performance hack, but it allows for commiting changes piece by piece and, what is more important, a place form making merge in. Cogito (alternate Git UI/porcelain) tries to hide index. By the way, I wonder how hg does merges without index to provide place where do merges in...

Third, explicit/on-demand packing. This allows for the most (I think) compression of all SCMs, and for the wire format to be the same as on-disk format (with the addition that you can send thin packs on wire). As of now no porcelain tries to hide it, although with the latest work allowing for historical packs it would be easy to add this without significantly affecting preformance.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

← back to recent threads