[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Mismerge case

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-08-10 22:05:47 CEST

Greg Hudson <ghudson@MIT.EDU> writes:

> while gnu diff happens to produce a more natural diff. However, I
> think it's also the case that diff3 requires some unmodified context
> between changed lines in order to perform a clean merge, and we are
> not requiring any context, which is kind of unsafe.

We don't require context, see the merge_adjacent_changes test in
tests/libsvn_diff/diff-diff3-test.c.

> Can anyone more knowledgeable about libsvn_diff speak to that?

The change from

   a
   b
   c
   d
   e

to

   a
   Q
   c
   d
   e

i.e. the second line changes from b to Q, is to be merged into

   V
   b
   W
   X
   Y
   Z
   b
   c
   d
   e

Which of the two lines b should get changed to Q, the first, the
second or neither? Subversion doesn't rely on context, in this case
it gives:

$ tools/diff/diff3 mine orig your

   V
   Q
   W
   X
   Y
   Z
   b
   c
   d
   e

GNU diff3 requires context and so creates a conflict:

   <<<<<<< mine
   V
   b
   W
   X
   Y
   Z
   b
   ||||||| orig
   a
   b
   =======
   a
   Q
>>>>>>> your
   c
   d
   e

We could make Subversion's diff require context, like GNU diff3, but
at the expense of making some currently successful merges into
conflicts. Would that be an improvement? It's not clear; in lots of
cases Subversion's ability to merge without context produces the right
result in cases where GNU diff would produce a conflict.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 10 22:07:00 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.