git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Wolf <jw@raven.inka.de>
To: Avery Pennarun <apenwarr@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Trying to sync two svn repositories with git-svn (repost)
Date: Sat, 9 May 2009 01:58:22 +0200	[thread overview]
Message-ID: <20090508235821.GO15420@raven.wolf.lan> (raw)
In-Reply-To: <32541b130905081344m634a78d5l984f4903ec1515eb@mail.gmail.com>

On Fri, May 08, 2009 at 04:44:39PM -0400, Avery Pennarun wrote:
> I agree that gitk's lane-changing can be a bit confusing.  Could you
> try making a slightly modified version of your script, where you only
> cherry-pick one or two commits in each direction?  That should be
> functionally identical, but a much simpler diagram.

Somehow I can't keep git-svn from fetching all the svn revisions, thus
it's still split over a long distance.

But in the meantime, I've hacked a quick-n-dirty script to show only
the 'interesting' commits with an optional context.  This helped me a
lot to get a better understanding what's going on.  I have appended the
result at the end of this mail.  Please convert it with "dot -Tps" to
postscript to view the result.

So here I go again with my attempt to analyze what happens.  I attach
the sha1 of created commits as a comment to the command that creates the
commit.

  # 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


Now, when I do

  git checkout svn-2       # same thing happens when svn-2/trunk is used
  git merge --no-ff svn-1

And here I'm completely barfed.  The tree is set _identical_ to the tree
in 2379d.  All the differences which should be kept are lost here.
I can easily see (although I don't know how to avoid it) why a5cf3..c3ff2
might be applied to svn-2 and svn-2/trunk though it should not be applied.

But I completely fail to see why the tree is set identical to 2379d.


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"] ;
}

  reply	other threads:[~2009-05-09  1:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-27 20:12 Trying to sync two svn repositories with git-svn (repost) Josef Wolf
2009-04-28 20:30 ` Josef Wolf
2009-04-28 20:53 ` Avery Pennarun
2009-04-28 22:37   ` Josef Wolf
2009-04-29  3:19     ` Avery Pennarun
2009-04-29 16:01       ` Josef Wolf
2009-04-29 18:13         ` Avery Pennarun
2009-04-29 22:37           ` Josef Wolf
2009-04-30  2:07             ` Avery Pennarun
2009-04-30 22:28               ` Josef Wolf
2009-04-30 22:59                 ` Avery Pennarun
2009-05-01 14:28                   ` Josef Wolf
2009-05-01 19:17                     ` Avery Pennarun
2009-05-02 21:58                       ` Josef Wolf
2009-05-04 15:58                         ` Avery Pennarun
2009-05-04 21:14                           ` Josef Wolf
2009-05-06 18:52                             ` Josef Wolf
2009-05-06 19:23                               ` Avery Pennarun
2009-05-06 22:50                                 ` Josef Wolf
2009-05-08 20:44                                   ` Avery Pennarun
2009-05-08 23:58                                     ` Josef Wolf [this message]
2009-05-13 12:09                                       ` Josef Wolf
2009-05-13 17:28                                         ` Avery Pennarun
2009-05-13 22:22                                           ` Josef Wolf
2009-05-14  6:35                                             ` Avery Pennarun
2009-05-14 21:41                                               ` Josef Wolf
2009-05-14 21:57                                                 ` Avery Pennarun
2009-05-15 17:52                                                   ` Josef Wolf
2009-05-15 19:05                                                     ` Avery Pennarun
2009-05-17 11:24                                                       ` Josef Wolf
2009-05-20 16:40                                                       ` Josef Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090508235821.GO15420@raven.wolf.lan \
    --to=jw@raven.inka.de \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).