I’ve Switched to Darcs

I’ve converted 24 public projects from Subversion or Arch to Darcs, preserving full history, as I mentioned earlier. It all went very smoothly. I’m even maintaining my Arch utilities in darcs :-)

Some small observations:

  • Committing early and often is good.
  • When a commit is virtually instantaneous, it’s easy to commit early and often. A commit in darcs doesn’t require it to hit the network.
  • Branching is a frequent need and is done far to infrequently. But Darcs makes it even easier than Arch. Very nice.

9 thoughts on “I’ve Switched to Darcs

  1. You’ve convinced me to switch to darcs, after some unsatisfactory attempts with arch. Thanks for arch2darcs!

    1. jgoerzen says:

      Glad you are finding it useful. Hope darcs turns out well for you, too.

  2. Anonymous says:

    I’ve tried darcs several times, and I find it quite easy to use. My one issue with it is that it can’t seem to handle merges from a common ancestor very well at all. Could you perhaps write something about your experiences with this? Suppose that I’ve created a repository, branched something from the trunk, and hacked on both; if the changes don’t conflict, darcs seems to merge them just fine, but how about if the changes conflict?

    1. jgoerzen says:

      This is a good question, and something I had to satisfy myself with too. This is probably the most common complaint mentioned against darcs.

      In the time I’ve been using darcs, I’ve found it handles conflicts quite well — about as well as tla or Subversion.

      The one case where it seems to have trouble is if there are patches that independently add files or directories with the same name. (I mean new files show up independently, with differently-named patches, in the trees that are to be merged.) David is aware of that issue, but it is really quite rare in practice. In fact, it generally shows up when you try to merge trees that don’t share a common ancestor, an operation that no revision control system does a very good job at, IMHO.

      Anyway, you can pretty easily see what darcs will do with a basic test. Here’s what I did:


      ~/tree/t$ darcs get ../sgml-common sgml-common1
      Copying patch 25 of 25... done!
      Finished getting.
      /tree/t$ darcs get ../sgml-common sgml-common2
      Copying patch 25 of 25... done!
      Finished getting.
      ~/tree/t$ cd sgml-common1/sgml-common
      ~/tree/t/sgml-common1/sgml-common$ emacs SConstruct
      ~/tree/t/sgml-common1/sgml-common$ darcs record -am 'Test commit 1'
      Finished recording patch 'Test commit 1'
      ~/tree/t/sgml-common1/sgml-common$ cd ../../sgml-common2/sgml-common
      ~/tree/t/sgml-common2/sgml-common$ vim SConstruct
      ~/tree/t/sgml-common2/sgml-common$ darcs record -am 'Test commit 2'
      Finished recording patch 'Test commit 2'
      ~/tree/t/sgml-common2/sgml-common$ darcs pull -a ~/tree/t/sgml-common1
      We have conflicts in the following files:
      ./sgml-common/SConstruct
      Finished pulling.
      jgoerzen@katherina:~/tree/t/sgml-common2/sgml-common$ head SConstruct
      # vim: set filetype=python :
      from glob import glob
      v v v v v v v
      import os, re, ConfigParser
      *************
      import re, os
      ^ ^ ^ ^ ^ ^ ^

      So, it highlighed the conflicting section in the file in much the same way as other version control systems would. darcs pull also has an --external-merge command so you can use some other tool to merge conflicts. There are examples of using Emacs and kdiff3, opendiff, or xxdiff as an external merge command.

      1. Anonymous says:

        Thank you very much for providing this information. It looks like darcs has gotten significantly better at handling merges and conflicts than it was last time I tried it.

  3. marty says:

    congratulations on switching to darcs. I was wondering when you were going to do that. With the wind blowing poor Terah around, darcs will provide a deeper anchor. Be sure and separate your darcs from your whites before you do laundry. regards, marty

    1. jgoerzen says:

      <grin> Thanks for the well wishes :-)

  4. jgoerzen says:

    You’ve convinced me to give DARCS a serious look for my next project. I hope you’ll post updates over the next month or two.

    You say commits are very fast. What about synchronization between repositories, is that also fast? And does DARCS have an emacs frontend similar to the one for CVS?

    1. jgoerzen says:

      Yes, I’ll keep posting updates.

      I’ve found synchronization across the network to be somewhat faster than Arch, and of course on a local disk, it is quite fast.

      The Darcs wiki is a great resource, and has a page listing several options for Emacs, including both VC integration and standalone tools.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.