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.