monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Non-modal merge


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Non-modal merge
Date: Mon, 24 Sep 2007 17:35:33 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Sep 24, 2007 at 06:15:47AM -0400, Stephen Leake wrote:
> The code that does this is in diff_patch.cc merge_via_edit_scripts. I
> don't fully understand how it works :). Adding this feature is
> probably more work that it's worth, since external diff3 with Emacs
> works fine for me. 

In the long run we should really get full merging stuff (including
conflict marking) into mtn core, though, external dependencies like
diff3 are a massive pain.

> In any case, monotone's diff algorithm is clearly different from
> diff3. Whether it's better in some sense is a separate question; for
> consistency, it might be worth using it for conflicts as I outlined
> above. I'll wait for other comments on this before doing anything.

It's not very different, in principle -- they both find the "longest
common subsequence", which is a precisely defined mathematical
concept.  There are two reasons they might give different results,
though -- diff3 has some heuristics to speed up running time when you
don't pass -u (it doesn't *actually* find the longest common
subsequence, just one that's... pretty long), and even if you do pass
-u, there can be multiple different longest common subsequences, so
just by chance two different algorithms will give different results.

None of this really makes one superior to the other, the advantage is
that calling out to diff or diff3 is tricky, fragile, and makes mtn
harder to distribute.

> One data point; I have recently become dissatisfied with the results of
> the default merge that CVS does; it often gets the wrong result (by my
> criteria). So I'm hoping monotone does a better job - I haven't used
> it enough yet to tell for sure, but it hasn't done anything wrong yet.

There are lots of cases where a merger will give less-than-satisfying
results -- some will be shared between cvs and mtn's current mergers,
some won't.  Line merging is one of those things that's almost
impossible to improve via airy theory, though; please please collect
examples where it does the Wrong Thing, and if we collect enough we'll
catch them all eventually, hopefully.

-- Nathaniel

-- 
So let us espouse a less contested notion of truth and falsehood, even
if it is philosophically debatable (if we listen to philosophers, we
must debate everything, and there would be no end to the discussion).
  -- Serendipities, Umberto Eco




reply via email to

[Prev in Thread] Current Thread [Next in Thread]