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
SBStephen Bash <bash@genarts.com>
Date
Oct 21, 2010, 21:27 UTC
Message-ID
<20420115.537598.1287696462845.JavaMail.root@mail.hq.genarts.com>
In-Reply-To
<201010212037.09618.jnareb@gmail.com>
----- Original Message -----
Show 13 quoted lines
> From: "Jakub Narebski" <jnareb@gmail.com>
> To: "Stephen Bash" <bash@genarts.com>
> Sent: Thursday, October 21, 2010 2:37:07 PM
> Subject: Re: Converting to Git using svn-fe (Was: Speeding up the initial git-svn fetch)
>
> > > Of course, "ignoring merges" is temporary and a total cop-out
> >
> > This is still bugging me... Even with svn mergeinfo (which I think
> > is a small percentage of the SVN revisions in the world),
> 
> From what I understand to have svn:mergeinfo you have to have version
> >= 1.5 of Subversion installed on server, and to use it also >= 1.5
> client.
Correct.  I can't find a release date for 1.5, but my impression is a lot of history in SVN repositories pre-dates 1.5 (especially since it required *both* the client and the server to be updated).  That impression is mostly based on my own experience...  Using Subversion heavily from 2003 to late 2009 my memory is mostly of 1.3 and 1.4 -- I probably only upgraded if I was setting up a new machine or some fancy new tool I was using required the newest version.
 
> But because Subversion doesn't impose strict separation between branch
> namespace and in-repository paths, somebody somewhere would certainly
> at some time screw this up. And only then we would have to rely on
> subtree merge / git-subtree split similarity detection.
I don't have much experience with subtree merge...  It's possible that will improve the situation.
> BTW. Subversion doesn't have "svn cherry-pick", nor equivalent to
> "git reset" == "git cherry-pick -R"... well, at least I don't think it
> has.
See below...
> 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...
 
Show 10 quoted lines
> ---1---B---2---3---M1--4---5---M2 <-- foo
>         \         /           /
>          \-a---b-/-----c---d-/ <-- bar
> 
> B is branching point, M1 and M2 are merge commits.
> 
> In Git, and I assume that also in Subversion, when doing merge M1, the
> VCS notices that from revision B branches 'foo' and 'bar' have common
> commits (in git we say that merge base of 'foo' and 'bar' at the point
> of doing merge M1 is commit B). 
I'm going to take a little liberty with SVN revisions because I've always thought of SVN revisions as before and after the change, so a:b in SVN is the change introduced in b, but since we're on the Git list, in the following examples I will use a:b to mean the changes introduced in both a and b.  (Since it was introduced, I've always read "svn diff -c rev" as "svn diff -r rev-1:rev")
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.  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.  The concept of *not* specifying revision numbers to merge is new in 1.5. See
http://svnbook.red-bean.com/en/1.4/svn.branchmerge.copychanges.html
This is what scares me about mapping SVN merges to Git merges.  It seems post-1.5 merges have a lot more in common with Git than pre-1.5 (though mergeinfo is still brain damaged -- easy branching and merging is why I switched!), but I think we still need to support pre-1.5.

Thanks, Stephen

Previous: Jakub NarebskiNext: Jakub Narebski
Message 44 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.