Rotating Header Image

Darcs repository space saving

For some of you out there that have many repos floating with libraries in them that are either accessed infrequently, or only file-accessed, you may, like me, want to reduce the disk footprint of the repository. Darcs, in fact, keeps a complete copy of the pristine repository in the directory _darcs/current. So if you have large files in your repository (for instance data sets), you’re storing them twice.

I had tried before to remove this directory, however when I then tried to use darcs functions I would get the error:

darcs failed:  Pristine tree doesn't exist.

Reading through the different options I found the repair option, but that gave me the same complaint. Today on #darcs, Heffalump told me that I had to ensure the directory _darcs/current actually exists for it to work. So indeed, after creating an empty directory there, repair worked perfectly, and I can now happily remove redundant storage \o/.

It seems, as well, that the operation copies the current directory to current-old. Additionally in newer versions of darcs, the directory seems to be renamed to pristine. As a last note, Igloo mentioned that if one does not want a pristine or current copy, then one can touch the file _darcs/current.none (or _darcs/pristine.none). I will have to experiment with this feature.

It might be a nice idea if darcs detected the lack of the directory and created it if it was missing.

Be Sociable, Share!

One Comment

  1. Christophe (vincenz) says:

    I’m happy to report that the current.none trick works in the rather ancient darcs version(1.0.3) that shipped with ubuntu. Granted, it does make operations somewhat slower, but that is always the big trade-off in any system, computation vs storage.

Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>