Gitacular!

July 26th, 2008

The title here may be a bit misleading, I just really wanted to play with the word “git.” This post will largely be focused on my issues with git.

RTFM NOOB

Git seems to be a new sacred cow. Any complaints are generally responded to with the assumption that the complainer is is definitely the one at fault. This may be attributed to the user’s stupidity or, more creatively, the user’s cleverness.

Most recently I’ve seen PJ Hyett tweet the following:

when people get upset at git, it’s because they’re trying to do something clever and bad things happen. stop trying to be clever.

This may in fact be true in some cases but, claiming this is always the case is foolish at best.

A Tangent on GitHub

Since I just cited one of the minds behind GitHub I thought I should give some thoughts on GitHub.

GitHub is pure unadulterated awesome.

In a way, GitHub is the antithesis of the mess that is Git. The guys behind GitHub seem to pay attention to every little detail of the user interface. Git’s user interface in contrast appears to be put in place grudgingly by the Git developers who are outraged that users even need to interface with their masterpiece.

GitHub seems to be the developer’s social network and I love it.

On User Interface

The most obvious flaw is the lack of consistency in the commands:

git stash apply git rebase --continue git svn clone git commit -a -m

Can we kindly pick one style? Either sub-commands (like apply) or options to commands (like –continue), pick one and stick with it. This reminds me of the inconsistencies in the function naming of PHP. I don’t want to be reminded of PHP, I have enough nightmares as it is.

Other notable issues are displaying files in conflict as “unmerged” instead of say “conflict” as well as using “git add” to resolve conflicts instead of something like “git resolve.”

Another Tangent on user Interface

It seems odd to me that a community obsessed with perfection and beauty the way the Rails community is would accept and in some cases, defend a tool like this.

As Ruby and Rails developers we all know interface, at all levels, matters. I’m also sure we’ve all re-factored working code because it was not idiomatic Ruby, in other words it offended our sense of style and beauty (yes, I’m simplifying the reasons for re-factoring ugly code, I know). So, I’m genuinely curious, when other equally powerful tools exist, what drove the early adoption of Git in the Ruby community?

Oh, There Are Bugs

Please, follow this and tell me what I’m doing wrong:

So, everything goes as expected until the conflict that happens during the rebase-ing of the branch to the latest changes made in master.

At line 50 you see me fix the conflict. I then verify the contents of the conflicted file on line 51. I add the file on line 53. Then I try to continue and the fun begins.

At this point I’ve fixed the conflict and added the file yet, git is swearing no changes have been made. When I first ran across this, it resulted in lots of research trying to figure out what I was doing wrong. Only after far too much time wasted on this did I get desperate and add some random whitespace and add the file again. Turns out this pretty reliably corrects this issue.

Another confidence inspiring issue is also rebase conflict related. Unfortunately, I can’t easily duplicate this issue so you’ll have to take my word for it.

Same circumstances, I fix a conflict and add the file. When I try to continue I get a different error message from above but still suggesting I forgot to use “git add.” Again, after much research and random attempts to move forward, I found “git status” fixes this and allows me to continue.

Yes, you read that right, a command meant to simply report the status of the repo is fixing my repo. It’s obviously updating something, somewhere deep in the .git directory that tells “git rebase –continue” that I have in-fact added the file. This is difficult to duplicate but, I have seen it several times.

“Rich, why do you hate Git?”

I don’t hate Git. I happen to think it’s a great tool and an unbelievable improvement over the tools we used to be saddled with. I just happen to think that there are tools out there that are just that much better than Git.

I’m also posting this because I got a few responses (both public and private) to my complaints on twitter acting like I’m an imbecile with no clue what I’m doing. I’m definitely not a Git power user, I’ll give you that but, I always make an effort to be familiar with my tools and the best practices involved. With my relatively simple usage, I shouldn’t be running into these problems.

The only thing tying me to Git is for compatibility with the broader Ruby community. I obviously don’t expect that to change but, we need to acknowledge issues with our tools and address them, not ignorantly ridicule the people pointing them out.

Sorry, comments are closed for this article.