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 21, 2010, 22:49 UTC
Message-ID
<201010220049.33344.jnareb@gmail.com>
In-Reply-To
<20420115.537598.1287696462845.JavaMail.root@mail.hq.genarts.com>
On Thu, 21 Oct 2010, Stephen Bash wrote:
> Jakub Narebski <jnareb@gmail.com> wrote:
Show 7 quoted lines
> > 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. 
I mean here the method used by "subtree" merge strategy, not by subtree
merge itself, i.e. the mechanism which make git apply changes to subtree
merged subproject at correct place.
 
Show 5 quoted lines
> > 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...

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.  This is quite different
from merge, where you find comon ancestor and then perform 3-way merge
(ours, theirs, ancestor).  Is merging in Subversion using 3-way merge
(like 'cvs update -j ... -j ...' is), or re-applying changes?
Show 5 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?

Show 17 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")
 
"git show rev" always show changes to parent, i.e. the same as 
"git diff rev^ rev" (rev^ ~= rev-1, if rev is not merge commit).
 
Show 11 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.

So it was "make branching easy and O(1)"... and they forgot that branching standalone doesn't make much sense, and that easy *merging* is also required. Merging in pre 1.5 times is as bad as in CVS.

Show 12 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.
Show 9 quoted lines
> 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.   
-- 
Jakub Narebski
Poland
Previous: Stephen BashNext: Stephen Bash
Message 45 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.