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

Re: Trying to sync two svn repositories with git-svn (repost)

From
JWJosef Wolf <jw@raven.inka.de>
Date
May 13, 2009, 12:09 UTC
Message-ID
<20090513120922.GP15420@raven.wolf.lan>
In-Reply-To
<20090508235821.GO15420@raven.wolf.lan>
On Sat, May 09, 2009 at 01:58:22AM +0200, Josef Wolf wrote:

After lots of trial-and-error, I guess I've located the reason of one of the failures. Please see below:

Show 40 quoted lines
>   # Create tags so we can see later what we have done
>   #
>   git tag svn-1-orig svn-1
>   git tag svn-2-orig svn-2
> 
>   # move cherries from svn-1 to svn-2
>   #
>   git svn fetch svn-1
>   git checkout svn-2
>   [ cherry-picking, creates 67446..0a742 ]
>   git merge --no-ff -s ours svn-1 -m 'merge ours svn-1 to svn-2' # 5d9a0
>   git checkout svn-2/trunk
>   git merge --no-ff svn-2 -m 'merge svn-1 to svn-2'              # f80d2
>   git svn dcommit
> 
>   # check the results
>   #
>   git diff svn-2-orig svn-2/trunk
>   git diff svn-2-orig svn-2
> 
>   # move cherries from svn-1 to svn-2
>   #
>   git svn fetch svn-2
>   git checkout svn-1
>   [ cherry-picking, creates a5cf3..c3ff2 ]
>   git merge --no-ff -s ours svn-2 -m 'merge ours svn-2 to svn-1' # 2379d
>   git checkout -q svn-1/trunk
>   git merge --no-ff svn-1 -m 'merge svn-2 to svn-1'              # 693fa
>   git svn dcommit --no-rebase
> 
>   # again, check the results
>   #
>   git diff svn-1-orig svn-1/trunk
>   git diff svn-1-orig svn-1
> 
> At this time, I made the graph attached below.  Two things are
> interesting in this graph:
> - svn-1 has all the imported commits and all the cherries as parent
>   svn-2 does _not_ have a5cf3..c3ff2 as parent
> - same thing happens for remotes/svn-2/trunk vs. remotes/svn-2/trunk

So, in order to mark a5cf3..c3ff2 as ancestors of svn-2, I've inserted following step at this place:

  git checkout svn-2
  git merge --no-ff -s ours svn-1

This works fine, a5cf3..c3ff2 are now recorded as ancestors of svn-2 and will no longer be picked on future merges.

  git checkout svn-2/trunk
  git merge --no-ff -s ours svn-1
  git svn dcommit

Now here's the problem: This last dcommit does simply a reset, because nothing has changed since the last dcommit. So a5cf3..c3ff2 are _not_ marked as ancestors of svn-2/trunk, causing those cherries to be rebased at the next dcommit with real changes.

Unfortunately, dcommit doesn't seem to have an option to force rebase instead of resetting.

Any ideas how to mark those commits as ancestors of svn-2/trunk?
Show 55 quoted lines
> Here is an overview of the created commits:
> 
> # b8bf1, 8536f..09393, d0f29   imported from svn-1 repository
> # 7b397, 17156..e0772, 05eb1   imported from svn-2 repository
> # a5cf3..c3ff2                 cherries from svn-2 to svn-1
> # 67446..0a742                 cherries from svn-1 to svn-2
> # 5d9a0     merge ours svn-1 to svn-2
> # 693fa     merge svn-2 to svn-1
> # 2379d     merge ours svn-2 to svn-1
> # f80d2     merge svn-1 to svn-2
> 
> And here's the .dot graph.  Please pipe it through "dot -Tps" to create
> a postscript file of the graph.
> 
> strict digraph G {
>   size = "7,10"
>   "8536f" [label="8536f"] ;
>   "b8bf1"->"8536f"  ;
>   "693fa" [label="693fa\nremotes/svn-1/trunk"] ;
>   "d0f29"->"693fa"  ;
>   "2379d"->"693fa"  ;
>   "5d9a0" [label="5d9a0\nsvn-2"] ;
>   "d0f29"->"5d9a0"  ;
>   "0a742"->"5d9a0"  ;
>   "f80d2" [label="f80d2\nremotes/svn-2/trunk"] ;
>   "05eb1"->"f80d2"  ;
>   "5d9a0"->"f80d2"  ;
>   "b8bf1" [label="b8bf1"] ;
>   "09393" [label="09393"] ;
>   "8536f"->"09393" [style="dotted"] ;
>   "05eb1" [label="05eb1\nsvn-2-orig"] ;
>   "e0772"->"05eb1"  ;
>   "67446" [label="67446"] ;
>   "05eb1"->"67446"  ;
>   "d0f29" [label="d0f29\nmaster\nsvn-1-orig"] ;
>   "09393"->"d0f29"  ;
>   "a5cf3" [label="a5cf3"] ;
>   "d0f29"->"a5cf3"  ;
>   "17156" [label="17156"] ;
>   "7b397"->"17156"  ;
>   "2379d" [label="2379d\nsvn-1"] ;
>   "c3ff2"->"2379d"  ;
>   "5d9a0"->"2379d"  ;
>   "0a742" [label="0a742"] ;
>   "67446"->"0a742" [style="dotted"] ;
>   "c3ff2" [label="c3ff2"] ;
>   "a5cf3"->"c3ff2" [style="dotted"] ;
>   "7b397" [label="7b397"] ;
>   "e0772" [label="e0772"] ;
>   "17156"->"e0772" [style="dotted"] ;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Josef WolfNext: Avery Pennarun
Message 22 of 31 in “Trying to sync two svn repositories with git-svn (repost)”
  1. Josef WolfApr 27, 2009
  2. Josef WolfApr 28, 2009
  3. Avery PennarunApr 28, 2009
  4. Josef WolfApr 28, 2009
  5. Avery PennarunApr 29, 2009
  6. Josef WolfApr 29, 2009
  7. Avery PennarunApr 29, 2009
  8. Josef WolfApr 29, 2009
  9. Avery PennarunApr 30, 2009
  10. Josef WolfApr 30, 2009
  11. Avery PennarunApr 30, 2009
  12. Josef WolfMay 1, 2009
  13. Avery PennarunMay 1, 2009
  14. Josef WolfMay 2, 2009
  15. Avery PennarunMay 4, 2009
  16. Josef WolfMay 4, 2009
  17. Josef WolfMay 6, 2009
  18. Avery PennarunMay 6, 2009
  19. Josef WolfMay 6, 2009
  20. Avery PennarunMay 8, 2009
  21. Josef WolfMay 8, 2009
  22. Josef WolfMay 13, 2009
  23. Avery PennarunMay 13, 2009
  24. Josef WolfMay 13, 2009
  25. Avery PennarunMay 14, 2009
  26. Josef WolfMay 14, 2009
  27. Avery PennarunMay 14, 2009
  28. Josef WolfMay 15, 2009
  29. Avery PennarunMay 15, 2009
  30. Josef WolfMay 17, 2009
  31. Josef WolfMay 20, 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.