2007-07-31

All the cool kids are using Git

Yes, it used to be true that all the the cool kids were using darcs. Darcs is so 2005, though, so I've decided to take Git for a spin. Here's what I'm enjoying the most so far:

  • git-citool is a very cool GUI for picking what changes you want to commit, write the commit message, commit, push to a remote repository, and more. I love this little application. It lets me go through my changes in any order, go back to Emacs and fix any mistakes without losing my commit message or the list of changes I've already marked for commit. Love it.
  • gitk lets me visualize the repository history. All the patches, all the branches, all the diffs, all the commit logs, easily accessible within a few clicks. It's quite fast too.
  • Another useful feature git-citool has is a history browser that lets me browse my repository and see each file's history, which patches change which lines, navigate through the various past states of a file, etc.

And, of course, Git has all those great characteristics of a distributed VCS. I've missed some things from Darcs though:

  • For smaller changes I prefer darcs record over having to reach for the mouse with git-citool and git-add -i isn't as nice.
  • darcs revert allows me to revert individual hunks within a file, with a nice interface too.
  • darcs unpull and darcs unrecord allow me to get rid of patches without having to generate a reversion patch (which is what Git does if the patch you want to revert is not the very latest patch). Also, they keep any local changes untouched.
  • darcs pull lets me pull only the patches I want from another repository. I haven't found a way to do that in Git.
  • Darcs's no effort spontaneous branches are a joy. No need for explicit branch creation. You just create copies of your trees and move individual patches around whenever you feel like doing so. This way you can easily, say, merge only some of the changes from one branch into another, quickly discard a branch, etc.

Darcs has well-known performance issues, I've watched it sit forever trying to apply some patch. This hasn't been a great problem for me with the small projects I usually work on though, so I don't really regard that as a bit advantage of Git's.

For me, it's the tools. I have moved some of my stuff over to Git but I still like a lot of aspects of Darcs's workflow. Perhaps some more experience with Git will change my mind, or perhaps Darcs-Git will be the VCS really cool kids will be using in the future. We'll see.

If you're interested in trying Git out, have a look at Git For SBCL Hackers and Everyday GIT With 20 Commands Or So.

5 komentoj:

Dirk disse...

I was under the impression that "spontaneous branches" were one of Git's main features.

Anónimo disse...

does this mean cl-opengl is moving to git?

Attila disse...

the performance issues of darcs are coming from recording two conflicting changes in two repos, then pulling them into one repo and record a resolution.

now, repeat this a few times at the same position and darcs (as of today) gets into an exponential algorithm. there's a soc project to resolve this, we'll see where they are getting to.

it must be noted that this has nothing to do with the size of the repo, i've got a 70 MB sbcl darcs repo here with full history and it has no performance issues.

but yes, darcs' text interface, however well designed, is still a text interface.

hankhero disse...

Have you tried darcsum.el, it is a very nice way to pick what darcs patches you want to commit or revert and write commit messages from within emacs. I haven't used git-citool so I can't say how it compares.

Sam Ask disse...

Thank you for your article. I was almost ready to go and try Git out, almost... but then I watched "Linus Torvalds on git" at youtube.

Boy, what a turn-down. I know I am being irrational, but I found his attitude so glib I am going to give Darcs more time to mature.

Kategorioj