[darcs-users] Re: current status of darcs

Ian Lynagh igloo at earth.li
Sat Mar 10 15:42:26 UTC 2007


On Fri, Mar 09, 2007 at 04:16:42PM -0800, David Roundy wrote:
> 
> Igloo thinks (or thought?) we should go
> with a DAG, but I'm not unconvinced.

I wasn't prefering a DAG exactly.

IIRC you wanted "dead branch" patches, so if A and B commute then we
have

   +--- A ---
  /
-+
  \
   +--- B ---

before resolution and

   +--- A ---
  /
-+
  \
   +--- B --- <dead branch>

after resolving in favour of A. What I don't like is that if I resolve
in favour of B and we then pull from each other then we end up with

   +--- A --- <dead branch>
  /
-+---
  \
   +--- B --- <dead branch>

and no conflict.

I prefer actual conflict resolution patches, i.e. after resolutions we
would have

---+--- A ---
   |
   X--- B

and if you resolve the other way and we pull then we get a conflict:

    +---+--- A ---
   /    |
--+     X--- B
   \
    +---+--- B ---
        |
        X--- A

The resolution:

---+--- A ---
   |
   X--- B

is similar to the DAG

---+--- A -----+--
    \         /
     X-- B --+

but I don't think we would want to actually represent it as such.


There are two other things I don't like about tree idea, but I don't
have better suggestions for either of them:

1) Undead patches:

Suppose I have A, you have B and I pull from you (A and B conflict).
I resolve the conflict in favour of A. Then I have

-+-------A--    <- the live branch
  \
   +---B        <- a dead branch

Now suppose you record C (depends on B) and I pull from you again.
Then I have:

-+----+-----A--       <- a live branch
  \    \
   \    +---B---C--   <- a live branch
    \
     +---B            <- a dead branch

(the actual representation might not duplicate B, that's not important).

Here C is a live patch and it depends on B, so B is sort of live even
though we killed it. Note that if we unpull C then we shouldn't get

-+----+-----A--     <- a live branch
  \    \
   \    +---B--     <- a live branch
    \
     +---B          <- a dead branch

What happens if we resolve in favour of the BC branch? Do we still have
a dead B branch?

This all feels a bit unclean to me.

2) Multiple copies

Suppose I have a repo ABC with no dependencies. Then I can create three
repos AB, AC, BC (technically it should be AB, AC', B'C'', but the
primes aren't important for this so I'll omit them).

Then, in each repository I record a patch (X, Y and Z respectively)
which don't commute with any other patch, so now I have ABX, ACY, BCZ.
Now suppose I try to pull them all into a single repository. In order to
minimise disk use, and perhaps also the number of merging questions the
user has to answer, I'd like each patch to be in the tree only once.
However, while I can build

          +---- B --- X ---
         /
--- A --+
         \
          +---- C --- Y ---

there's no way to also get BCZ into the tree without duplication
(actually you can do this case by allowing a single copy of each patch
inverse, but I think in more complicated cases, such as ABCD commuting
freely and ABU+ACV+ADW++BCX+BDY+CDZ, I think that is not possible).


Thanks
Ian




More information about the darcs-users mailing list