git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Merging in Subversion 1.5 (was: Re: Using git to track my PhD thesis, couple of questions)

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Aug 31, 2009, 05:47 UTC
Message-ID
<20090831054714.GA6060@dpotapov.dyndns.org>
In-Reply-To
<1251661316.25764.4.camel@maia.lan>
On Mon, Aug 31, 2009 at 07:41:56AM +1200, Sam Vilain wrote:
Show 12 quoted lines
> On Fri, 2009-08-28 at 08:12 -0700, Jakub Narebski wrote:
> 
> > Also IIRC there is warning (well, at least there was in Subversion 1.5
> > release notes) that merge tracking doesn't work entirely correctly in
> > the face of criss-cross merges (multiple merge bases) and renaming
> > (although I do hope that they fixed problem with silent corruption if
> > there is rename during merge).
> 
> Not sure about that one.  I also heard - unconfirmed - that things start
> to go awry if you start branching off branches and merging around the
> place.  But if that happens it's likely a bug rather than a design flaw
> (I think).

Some of the initial issues that existed in SVN 1.5.0 have been resolved, but some others remain. Here is one bug report related to merge: http://subversion.tigris.org/issues/show_bug.cgi?id=2897 It was reported two years ago, but the problem is still not fixed. And there is a few others (some of them even older but even with less prospect of being fixed any time soon): http://subversion.tigris.org/issues/show_bug.cgi?id=2837 http://subversion.tigris.org/issues/show_bug.cgi?id=2898 http://subversion.tigris.org/issues/show_bug.cgi?id=3056 http://subversion.tigris.org/issues/show_bug.cgi?id=3157

I don't think they would exist for long if they were ease to fix. Merge in Subversion is essence automatic cherry-picking, and it is not easy to implement that in the way it would be reasonably fast and work correctly in a general case.

Darcs is probably the best when it comes to cherry-picking but clearly it is not a speed demon. In case of Subversion, the problem is worse, because it has to make decision on a per file basis rather than operate each patch as a unit. So, it is even more difficult to implement that correctly and efficiently.

What you can do relatively simple is to handle a of one directional merge, and that was the primary design goal of Subversion merge tracking feature.

Here is what Daniel Berlin wrote about it: <<< The initial merge tracking implementation was not meant to handle repeated bidirectional merging, at least, as designed.

It was designed to allow cherry picks, and mainly for maintaining feature branches that were mostly one way merges, with the very occasional merge in the other direction and then branch death :).

For these cases, it works out fine.

For more complex cyclical merge patterns, you really can't use what we've got. Trying to work around these cases, or build algorithms that handle them, is just going to lead you into 20 years of edge cases that made people come up with changeset dags in the first place.

>>>
Source: http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=892215

So, I do not think that SVN merge will ever work correctly for those edge cases.

But even if Subversion learns how to handle all those complex cases correctly, it will still come with some surprises. One of the main advantage of the simple 3-way merge is that it is easy to understand and it makes the right thing most of time. Linus provided a really good explanation of it here: http://thread.gmane.org/gmane.comp.version-control.git/60457/focus=60644

Dmitry
Previous: Sam VilainNext: david@lang.hm
Message 16 of 23 in “Using git to track my PhD thesis, couple of questions”
  1. seanhAug 27, 2009
  2. Sverre RabbelierAug 27, 2009
  3. Matthieu MoyAug 27, 2009
  4. Paolo BonziniAug 28, 2009
  5. Matthieu MoyAug 28, 2009
  6. seanhAug 28, 2009
  7. Matthieu MoyAug 28, 2009
  8. Matthias AndreeAug 28, 2009
  9. Merging in Subversion 1.5 (was: Re: Using git to track my PhD thesis, couple of questions)Jakub Narebski, Aug 28, 2009
  10. Avery PennarunAug 28, 2009
  11. Matthias AndreeAug 28, 2009
  12. Jakub NarebskiAug 28, 2009
  13. Matthias AndreeAug 28, 2009
  14. Avery PennarunAug 28, 2009
  15. Sam VilainAug 30, 2009
  16. Dmitry PotapovAug 31, 2009
  17. david@lang.hmAug 28, 2009
  18. Paolo BonziniAug 28, 2009
  19. demerphqAug 28, 2009
  20. david@lang.hmAug 28, 2009
  21. demerphqAug 28, 2009
  22. Junio C HamanoAug 27, 2009
  23. demerphqAug 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.