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

Re: Converting to Git using svn-fe (Was: Speeding up the initial git-svn fetch)

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 22, 2010, 10:38 UTC
Message-ID
<201010221238.07964.jnareb@gmail.com>
In-Reply-To
<4258434.537707.1287703612372.JavaMail.root@mail.hq.genarts.com>
On Fri, 22 Oct 2010, Stephen Bash wrote:
> ----- Original Message -----
> > From: "Jakub Narebski" <jnareb@gmail.com>
Show 13 quoted lines
> > Ah, I understand now that 'svn merge' (which is rather like 'cvs
> > update') can be used for cherry picking.
> > 
> > Sidenote: in Git cherry picking picks up change and applies it on top
> > of current branch as one would apply a patch.
> 
> Yes.
>
> > This is quite different
> > from merge, where you find comon ancestor and then perform 3-way merge
> > (ours, theirs, ancestor). 
> 
> Yes.
Well, I guess that 'svn merge -rN' (merging in a single revision) works
similarly to how git-cherry-pick works.
 
Show 11 quoted lines
> > Is merging in Subversion using 3-way merge
> > (like 'cvs update -j ... -j ...' is), or re-applying changes?
> 
> Appears to the be 3-way merge if I'm reading the SVN archives correctly:
>   "It's a basic diff3 algorithm. 'man diff3' to learn about it and play 
>    with GNU's implementation of diff3."
> http://svn.haxx.se/users/archive-2005-03/1232.shtml
> 
> So my *guess* is they derive a common ancestor from their copy
> information, but I'm sure someone else more knowledgable could say
> more about that.  

I guess that in Subversion <= 1.4 it takes N in 'svn merge -rN:M' as an ancestor version for 3-way merge, and that in Subversion >= 1.5 it takes last merged in state (from 'svn:mergeinfo' property[1]) if branch is merged subsequent time, or first common revision for both branches[2] if it is first merge.

[1] The 'svn:mergeinfo' is about "merged-in tracking" rather than about
    "merge tracking".  Though change in 'svn:mergeinfo' indicates a 
    merge commit.
[2] I guess this is to be able to find such common ancestor (common
    revision) on first merge is the reason why merging branch into trunk
         .---B---.---.---.---M---.
              \             /
               \---.---.---/
    and merging trunk into branch
         .---B---.---.---.---.---.
              \           \  
               \---.---.---M---.
    needs a manual (by the way of '--reintegrate' option) distinguishing.
 
Show 12 quoted lines
> > > > I have read some documentation about svn:mergeinfo property:
> > > > http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html
> > >
> > > I guess this the first time I've read the 1.5 version of the SVN
> > > Book.
> > > This has consequences below...
> > 
> > Errr... what consequences? a:b vs a-b being closed (inclusive) or open
> > (exclusive) from one or other end?
> 
> No, just that post-1.5 merges do actually start to look more like Git
> merges. 
Well, at least they can be unambigously detected, instead of relying on
parsing commit message of merge commit.
 
Show 19 quoted lines
> > > Back to the task at hand... having read the 1.5 SVN docs, I have no
> > > idea how this works now (big caveat!!!), but prior to 1.5 M1 would
> > > have been
> > >
> > >   svn switch svn://path/to/foo
> > >   svn merge -ra:b svn://path/to/bar destination-path
> > >
> > > which is "Take the changes introduced in revisions a through b, and
> > > apply them to the destination-path". This is why I think of SVN
> > > merges as cherry-picks -- I was allowed to specify exactly what
> > > changesets I wanted merge to work on.
> > 
> > On one hand side you "were allowed to specify exactly what changesets
> > you wanted to merge to work on", on the other hand side you *had* to
> > specify what changesets etc.
> 
> My point is because the user was required to specify the revisions
> to merge, I don't think an automated tool (i.e. the mapper) can make
> assumptions about what was actually merged in any given revision.  
The problem is with even detecting that it was a merge and not ordinary
commit (well, unless some commit convention was used for merge commits,
but how likely that is that it was applied thoroughly, consistently, and
without mistakes that would trip a parser of a merge detector).
 
Show 16 quoted lines
> > > To truly illustrate this, consider a' is in between a and b:
> > >
> > > ---1---B---2---3-------M1--4---5---M2 <-- foo
> > >         \              /           /
> > >          \-a---a'---b-/-----c---d-/ <-- bar
> > >
> > > I could
> > >
> > >   svn switch svn://path/to/foo
> > >   svn merge -ra':b svn://path/to/bar destination-path
> > >
> > > and "a" would never be merged back to foo.
> > 
> > Such merge would be hard to represent in Git, I think.
> 
> I agree.

Well, at least in a way that merge in git would consider the same revisions as already applied as Subversion would when merging.

-- 
Jakub Narebski
Poland
Previous: Stephen BashNext: Jakub Narebski
Message 47 of 52 in “Speeding up the initial git-svn fetch”
  1. Matt StumpOct 13, 2010
  2. Stephen BashOct 13, 2010
  3. Matt StumpOct 13, 2010
  4. Stephen BashOct 13, 2010
  5. Converting to Git using svn-fe (Was: Speeding up the initial git-svn fetch)Stephen Bash, Oct 14, 2010
  6. Jonathan NiederOct 14, 2010
  7. Sverre RabbelierOct 14, 2010
  8. Stephen BashOct 15, 2010
  9. Sverre RabbelierOct 15, 2010
  10. Stephen BashOct 16, 2010
  11. Sverre RabbelierOct 17, 2010
  12. David Michael BarrOct 17, 2010
  13. Ramkumar RamachandraOct 18, 2010
  14. Jonathan NiederOct 18, 2010
  15. Ramkumar RamachandraOct 18, 2010
  16. Sverre RabbelierOct 18, 2010
  17. Jonathan NiederOct 18, 2010
  18. Ramkumar RamachandraOct 18, 2010
  19. Sverre RabbelierOct 18, 2010
  20. Jonathan NiederOct 18, 2010
  21. Sverre RabbelierOct 18, 2010
  22. Jonathan NiederOct 18, 2010
  23. Sverre RabbelierOct 18, 2010
  24. Jonathan NiederOct 18, 2010
  25. Sverre RabbelierOct 18, 2010
  26. Jonathan NiederOct 18, 2010
  27. Ramkumar RamachandraOct 19, 2010
  28. Stephen BashOct 19, 2010
  29. Stephen BashOct 19, 2010
  30. Ramkumar RamachandraOct 19, 2010
  31. Stephen BashOct 19, 2010
  32. David Michael BarrOct 19, 2010
  33. Stephen BashOct 19, 2010
  34. Will PalmerOct 20, 2010
  35. Jakub NarebskiOct 20, 2010
  36. Will PalmerOct 20, 2010
  37. Jakub NarebskiOct 20, 2010
  38. mrevilgnomeOct 21, 2010
  39. Jakub NarebskiOct 21, 2010
  40. Stephen BashOct 21, 2010
  41. Will PalmerOct 21, 2010
  42. Stephen BashOct 21, 2010
  43. Jakub NarebskiOct 21, 2010
  44. Stephen BashOct 21, 2010
  45. Jakub NarebskiOct 21, 2010
  46. Stephen BashOct 21, 2010
  47. Jakub NarebskiOct 22, 2010
  48. Jakub NarebskiOct 21, 2010
  49. Jonathan NiederOct 21, 2010
  50. Ramkumar RamachandraOct 20, 2010
  51. Stephen BashOct 20, 2010
  52. Ramkumar RamachandraOct 20, 2010

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.