[darcs-users] Patches are immutable

Juliusz Chroboczek jch at pps.jussieu.fr
Sun Oct 24 21:09:13 UTC 2004


> I can record, test, fix, and rerecord a handful of patches as
> building blocks for the total change I am working on.  It's a good
> way of structuring the process.

Yes, this is a very legitimate request.  I believe that either
compound patches or patch superseding would fit your need.

Compound patches: you record ``Implement DWIM.''  Later on, you record
``Fix typo in DWIM.''  Then, you make a compound patch called
``Implement DWIM.'' that contains the two patches.

|darcs changes|, |darcs annotate| and so on only show you the compound
patch; so you live with the illusion of one monolithic ``Implement
DWIM.'' patch.  If, however, at a later time you want to find out how
you arrived to the polished DWIM implementation, you can always use
|darcs changes --explode|.

Patch subsumption: you record ``Implement DWIM.''  Later on, you find
a bug in DWIM, so you fix the bug, and ask darcs to 
|darcs subsume --patch='Implement DWIM.'|.  Darcs unpulls the old
patch, and creates a new patch that is marked as subsuming the old
one.  When you push your repo, the metadata included in the patch
causes the old ``Implement DWIM.'' patch to be unpulled from the
target repo.

The only trouble with either solution is of course that it hasn't been
implemented yet.  Fixing that is a simple matter of hacking.

                                        Juliusz




More information about the darcs-users mailing list