[darcs-users] I wish for mutable patches.

zooko at zooko.com zooko at zooko.com
Wed Oct 20 12:45:43 UTC 2004


I've been using darcs a lot for several months now.

In my private repositories, I use "rerecord" whenever I am changing something
that I *would* have put in the original patch if I had known.  I.e., I record a
patch, find a bug in it, rerecord it without that bug, and so forth.

I also use darcs to share patches with other users (namely the upstream author
of Shtoom, Anthony Baxter):

http://zooko.com/repos

Now I very much want to use darcs in the same way -- if I record a patch, and
then I push that patch to zooko.com/repos/shtoom/zookobranch, and then I find a
bug in that patch, I don't want Anthony, or anyone else, to see my original
buggy patch!  So nowadays what I do is I rerecord the patch locally (as above),
then I ssh into zooko.com, unpull the buggy patch, then return to my local repo
and push the rerecorded patch.

Now there is a big problem with this of course: as long as Anthony is just
browsing the patches on the web site, this does what I want, but if he gets a
patch by clicking the "diff" button, or even worse if he actually installs
darcs and pulls a patch, then trouble will ensure the next time I rerecord that
patch.

What I really want is for darcs to provide me with the notion of a "mutable
patch" -- if I record patch A, and then Anthony pulls patch A, and then 
I rerecord patch A (so we can call the new version A1 if you like), and then
Anthony pulls A1, I want it to Just Work as he and I both expect instead of to
screw his darcs repo up into a knot so that darcs hangs when he tries to use
it.

I know there are deep implementation issues with this and user-visible issues,
but after using darcs for a while, this is certainly what I wish for.

Here's a simple hack that would implement roughly what I want.  I could write a
darcs wrapper script that Anthony would use instead of using darcs.

a) I make sure that the short name of each patch is unique.
b) Whenever Anthony asks my script to pull a patch, my script first checks
   whether a patch with the identical short name is currently in Anthony's
   repo.  If it is, then my script first unpulls that patch before pulling the
   new patch by the same name.

Regards,

Zooko





More information about the darcs-users mailing list