[darcs-users] merge puzzle

zooko at zooko.com zooko at zooko.com
Fri Aug 5 14:29:05 UTC 2005


>From Nathaniel Smith's example:

https://yumyum.zooko.com:19144/pub/merge_puzzle.txt

The name of the file is inside the box.  The label floating outside the box is for discussing this tree of revisions.
   
A line with a "-C-" in the middle is a change.  A line with a "-M-" in the middle is a merge.

So 3l was created by merging 2l and 2r and choosing "c" to be the filename after the merge.

          .-.
          |a| 1
          '-'
         /   \
        C     C
       /       \
    .-.         .-.
 2l |b|         |c| 2r
    '-'         '-'
       \       /   \
        M.....M     C
         \   /       \
          .-.         .-.
       3l |c|         |d| 3r
          '-'         '-'

Question: when merging 3l and 3r, what do you expect to have happen?


Currently for filenames, darcs provides "conflict: a or c?", and for lines,
darcs provides "conflict: c or d?".

I am satisfied with the latter behavior, but after further discussion on IRC
with Aaron Bentley, I now believe that the correct answer would be "d".

By resolving the 2l vs 2r conflict in favor of "c", the user has indicated that
he chooses "c" over "b".  When pulling the "2r->3r" patch, then, which changes
"c" to "d", the user does not need to be bothered again.  It should be the same
as if he had pulled the "2r->3r" patch *without* first merging from 2l.

To put it another way, it doesn't make sense that merging 2l and resolving in
favor of c should change the behavior when pulling "2r->3r".

I can even see a glimmer of how this policy can be implemented in terms of
darcs patch theory...

Perhaps this discussion should be moved to another list?

Regards,

Zooko




More information about the darcs-users mailing list