[darcs-users] How to extend a patch theory to fully commute

Ben Franksen ben.franksen at online.de
Fri Nov 20 17:45:49 UTC 2020


Am 20.11.20 um 13:24 schrieb Ben Franksen:
>> I would like a patch theory where
>> conflict resolutions are just new patches that replace the conflicting
>> ones, and don't depend on the patches they're resolving.

What follows started out as describing a potential problem with this
idea, but in the end I found that is is easily solvable. The result may
even be an improvement over what we have today.

Remember that the actual named patches that the user interacts with
consist of multiple primitive patches (a "changeset"). Suppose for named
patches A=(a1;a2) and B=(b1;b2) we have a conflict, but only between a1
and b1 (this is a pretty typical scenario).

How do we present this at the user level?

The unresolved conflict is probably presented quite similar to how we do
it in Darcs now: we tell them that there is a conflict between A and B
and present the alternatives a1 and b1 as the "content" of the conflict,
e.g. using conflict markup.

So far so good. But what about conflict resolution? Suppose the user
decides that a1 is what they want after all. How do we represent the
chosen sequence, consisting of

  A=(a1;a2);B=(b2)

with a "crippled" B in a sensible way?

This is just a UI question, but it may be important. For instance, if a
different user later pushes B to another repo, they may be surprised to
see that what they push contains more prims than they could see i.e. it
will be the original B=(b1;b2)!

This suggests that we should present the "inactive" portions of a named
patch in a special way e.g. "shaded"or with a bit of extra markup. In
fact this may be superior to how Darcs operates today, where hitting 'v'
on a conflictor shows you its internal representation, which isn't too
helpful.

Cheers
Ben



More information about the darcs-users mailing list