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

Re: "svn diff" and "svn merge" sittin' in a tree

From: Mark Benedetto King <bking_at_answerfriend.com>
Date: 2002-02-15 22:36:36 CET

On Fri, Feb 15, 2002 at 03:08:12PM -0600, Karl Fogel wrote:
        [...]
> Yes, completely agree. Really perfect merging is much more
> sophisticated than either diff+patch or diff3, and is non-trivial to
> implement. Giving clients plug-in options is part of it (we'll have
> to supply that fourth file -- the true common ancestor -- for them,
> too!)
>

Speaking of four-file merges, the case that we've been talking
about *does* have a use for them:

imagine:

        foo:1 -> foo:2 -> foo:3
          |
        bar:1 -> bar:2 -> ... -> bar:6 -> bar:7

And we want to merge bar:6->bar:7 into foo:3.

Now, consider that foo:3 and bar:6 might be wildly
different, due to highly divergent development.

There are 3 relevant diff chunks:

Wander1 = foo:1/bar:1 -> foo:3
Wander2 = foo:1/bar:1 -> bar:6
Change = bar:6 -> bar:7

Now, in order to apply Change to foo:3, we need to know *where* to
apply it. The location in bar:6 could be vastly different from the
location in foo:3, and foo:3 could have repetitive data (we all know about
cut-n-paste programmers), so matching on context could be dangerous.
However, all is not lost, if we use Wander1 and Wander2 to generate
fixup information on Change.

Basically, Wander2 can put Change into foo:1/bar:1's "co-ordinate system"
and Wander1 can translate *that* change into foo:3's "co-ordinate system".

> The paper is www/variance-adjusted-patching.html, by the way. It
> probably suffers from making up terminology for things that already
> had accepted words, but the meaning is the same anyway.
>

I mentioned this to Karl on IRC and he told me to read v-a-p.html,
so I probably should.

> I don't think we're aiming for perfect merging right now. We just
> need to be as good as CVS, and that means diff3 with three files, no
> one of which is necessarily a common ancestor.
>

Yeah, but we might as well do as good a job as we can.

"Aiming at timelessness is a way to make yourself find the best answer: if
you can imagine someone surpassing you, you should do it yourself. Some of
the greatest masters did this so well that they left little room for those
who came after. Every engraver since Durer has had to live in his shadow."

                Excerpted from http://www.paulgraham.com/taste.html,
                which, btw, is a pretty good read.

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:08 2006

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.