[darcs-users] A proposal: patch incoherence

Marnix Klooster mklooster at baan.nl
Sat Nov 20 08:52:13 UTC 2004


Andrew Pimlott wrote Saturday, November 20, 2004 00:56:

> On Fri, Nov 19, 2004 at 08:34:02PM +0100, Juliusz Chroboczek wrote:
> > Every patch carries a list of patches that it is (directly) incoherent
> > with.  (Incoherence is antireflexive and symmetric.)
>
> In one sense, it cannot be symmetric, because only one patch knows that
> it is incoherent with the other.  This is good, because normally, you
> want the newer patch.  I would simplify most of the usage by saying that
> darcs always takes the newer patch unless you override.  Can you think
> of a common reason for wanting the old patch?

Logic tells us that

   P is incoherent with Q
==   {definition of incoherence}
   P is present => ! (Q is present)
==   {logic: property of =>}
   ! (P is present) \/ ! (Q is present)
==   {logic: \/ is symmetric}
   ! (Q is present) \/ ! (P is present)
==   {logic: property of =>, reversed}
   Q is present => ! (P is present)
==   {definition of incoherence, reversed}
   Q is incoherent with P

So incoherence is symmetric.  Therefore, if you (force darcs to) pull
P, then Q has to go.  If you pull Q, then P has to go.

And because the old patch P is gone from the source repo, you pull Q,
and you lose P, and therefore patch P has been lost from both repos.
As was the intention.

But the error message given when trying to apply an incoherent patch
should probably be more severe if that patch is *older* than the
related patch(es) the target repo already has.

Groetjes,
 <><
Marnix




More information about the darcs-users mailing list