[darcs-devel] darcs patch: Cache pristine directory within NoPristine.

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Fri Apr 29 09:04:00 PDT 2005


>> > I'm still not sure why you are worrying about this, though: if you want
>> > to do stuff that needs a pristine then surely you should have a
>> > pristine?

>> What do you mean?  Is ``you'' above me (J.Ch.) or the user?

> Why is the user doing operations that want a pristine in a repo without
> one, and why are you (J.Ch.) trying to encourage them by making it less
> painful?

Ah, okay, I see you've not been using pristine.none repos.  This is
the way Darcs has been working since I've implemented pristine.none,
all that the latest patch is trying to fix is the performance of that
behaviour.

Being the sort of person who still uses floppies, and being the proud
owner of a 16 MB USB key, I like my Darcs repos to use little space.
In olden times, I was doing things like

  cd /key/foo
  darcs repair
  darcs pull
  rm -r _darcs/current/*

which is ugly and requires temporarily having enough space on your USB
key to keep the pristine tree.  The pristine.none repository format
automates the above procedure, and also allows not generating the
pristine tree, even temporarily, under normal usage.

Some commands, however, require a pristine tree.  The easy way out
would have been to disallow them on pristine.none repositories; this,
however, would expose an implementation detail to the user.  The way
I've chosen was to create a pristine repository in /tmp on the fly.  I
happen to find this extremely convenient, and in the rare cases when I
need to run ``darcs whatsnew'' on a repository with no pristine tree,
I'm willing to deal with the performance hit.

A nice special case, by the way, are repositories with a recent
checkpoint but no pristine tree.  They are almost as fast as normal
repositories, but use significantly less space.

If you disagree with the above, I can implement the option
``--dump-core-if-no-pristine''.

                                        Juliusz




More information about the darcs-devel mailing list