{"thread":{"id":"11659","subject":"git-svn: how to connect SVN branches?","startedAt":"2008-01-17T20:17:32Z","lastAt":"2008-01-18T14:43:44Z","messageCount":4,"participants":["dherring@ll.mit.edu","Sam Vilain","Gregory Jefferis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"65780","messageId":"alpine.LNX.0.999999.0801171237110.3479@mojave","threadId":"11659","inReplyTo":null,"subject":"git-svn: how to connect SVN branches?","fromName":"","fromEmail":"dherring@ll.mit.edu","sentAt":"2008-01-17T20:17:32Z","receivedAt":"2008-01-17T20:17:32Z","isPatch":false,"sender":{"key":"dherring@ll.mit.edu","avatar":null},"body":"Hi,\n\nThe project I'm tracking changed servers a couple months ago.  To simulate \nthe svn-switch, I edited the svn-remote.url to the new location.  `git-svn \nfetch`, `git-svn dcommit`, and the like seemed to work ok.\n\nWhen a new release branch came out, I tried adding\nsvn-remote.branches = releases/*:refs/remotes/svn/*\n\n`git-svn fetch` pulled the new branch.  However, it created a whole new \nhistory for this branch (new git commits from the beginning of the SVN \nrepo).\n\nIs there some way to tell git/git-svn to connect these two histories?\n\nPictorially, I have\n\nSVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk\nSVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch\n\nand want\n\nSVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk\n                                  \\--SVNbranch\n\nSimilarly, if someone cloned a git repo full of git-svn-id's (which \nindicate that an svn --switch occurred) but without any matching git-svn \ndata, is there a way to `git-svn fetch` from the new SVN repo and \nautoconnect the git commits?\n\nThanks,\nDaniel\n"},{"id":"65790","messageId":"478FD0E5.2080006@vilain.net","threadId":"11659","inReplyTo":"alpine.LNX.0.999999.0801171237110.3479@mojave","subject":"Re: git-svn: how to connect SVN branches?","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-17T22:04:21Z","receivedAt":"2008-01-17T22:04:21Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"dherring@ll.mit.edu wrote:\n> Hi,\n> \n> The project I'm tracking changed servers a couple months ago.  To simulate \n> the svn-switch, I edited the svn-remote.url to the new location.  `git-svn \n> fetch`, `git-svn dcommit`, and the like seemed to work ok.\n> \n> When a new release branch came out, I tried adding\n> svn-remote.branches = releases/*:refs/remotes/svn/*\n> \n> `git-svn fetch` pulled the new branch.  However, it created a whole new \n> history for this branch (new git commits from the beginning of the SVN \n> repo).\n> \n> Is there some way to tell git/git-svn to connect these two histories?\n\ngit-svn doesn't yet support arbitrary mapping of paths like that.  You\nneed to add a separate git-svn remote, and you might have to graft to\nget it started - see below.\n\n> Pictorially, I have\n> \n> SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk\n> SVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch\n\nThat's unfortunate.  There are many things that git-svn does to try to\navoid this happening.  You can fix it using the .git/info/grafts\nfacility - check the Documentation/ for information on that.  Once\nyou've got it looking right, git filter-branch can be used to make it\npermanent, though you should certainly delete the git-svn metadata after\nusing that.\n\n> Similarly, if someone cloned a git repo full of git-svn-id's (which \n> indicate that an svn --switch occurred) but without any matching git-svn \n> data, is there a way to `git-svn fetch` from the new SVN repo and \n> autoconnect the git commits?\n\nYou basically have to fool git-svn by making commits in the history\nwhich have the git-svn-ids that you want.  This can be done without\nchanging the \"real\" history as above, using grafts.\n\nGood luck,\nSam.\n"},{"id":"65796","messageId":"C3B5987D.112BA%jefferis@gmail.com","threadId":"11659","inReplyTo":"alpine.LNX.0.999999.0801171237110.3479@mojave","subject":"Re: git-svn: how to connect SVN branches?","fromName":"Gregory Jefferis","fromEmail":"jefferis@gmail.com","sentAt":"2008-01-17T23:42:53Z","receivedAt":"2008-01-17T23:42:53Z","isPatch":false,"sender":{"key":"jefferis@gmail.com","avatar":"https://gravatar.com/avatar/8528f4e227ebc88380c203c816e263246064e31f6180681dc2c6dabfaff24d6b?d=mp&s=160"},"body":"Re connecting the two svn histories, there are some similarities to a\nsituation that I had.  See:\n\nStatement of problem:\nhttp://permalink.gmane.org/gmane.comp.version-control.git/69486\n\nEventual solution:\nhttp://thread.gmane.org/gmane.comp.version-control.git/69486\n\nNicely formatted code snippet:\nhttp://pastie.textmate.org/private/pv1n1nbmcmtxnxbq4zd7w\n\nBest,\n\nGreg.\n\nOn 17/1/08 20:17, \"dherring@ll.mit.edu\" <dherring@ll.mit.edu> wrote:\n\n> Hi,\n> \n> The project I'm tracking changed servers a couple months ago.  To simulate\n> the svn-switch, I edited the svn-remote.url to the new location.  `git-svn\n> fetch`, `git-svn dcommit`, and the like seemed to work ok.\n> \n> When a new release branch came out, I tried adding\n> svn-remote.branches = releases/*:refs/remotes/svn/*\n> \n> `git-svn fetch` pulled the new branch.  However, it created a whole new\n> history for this branch (new git commits from the beginning of the SVN\n> repo).\n> \n> Is there some way to tell git/git-svn to connect these two histories?\n> \n> Pictorially, I have\n> \n> SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk\n> SVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch\n> \n> and want\n> \n> SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk\n>                                   \\--SVNbranch\n> \n> Similarly, if someone cloned a git repo full of git-svn-id's (which\n> indicate that an svn --switch occurred) but without any matching git-svn\n> data, is there a way to `git-svn fetch` from the new SVN repo and\n> autoconnect the git commits?\n> \n> Thanks,\n> Daniel\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"65881","messageId":"alpine.LNX.0.999999.0801180932310.3479@mojave","threadId":"11659","inReplyTo":"478FD0E5.2080006@vilain.net","subject":"Re: git-svn: how to connect SVN branches?","fromName":"","fromEmail":"dherring@ll.mit.edu","sentAt":"2008-01-18T14:43:44Z","receivedAt":"2008-01-18T14:43:44Z","isPatch":false,"sender":{"key":"dherring@ll.mit.edu","avatar":null},"body":"Sam, Gregory, thanks for solving my problem.\n\nOn Thu, 17 Jan 2008, Sam Vilain wrote:\n> dherring@ll.mit.edu wrote:\n>> `git-svn fetch` pulled the new branch.  However, it created a whole new\n>> history for this branch (new git commits from the beginning of the SVN\n>> repo).\n>>\n>> Is there some way to tell git/git-svn to connect these two histories?\n>\n> git-svn doesn't yet support arbitrary mapping of paths like that.  You\n> need to add a separate git-svn remote, and you might have to graft to\n> get it started - see below.\n>\n>> Pictorially, I have\n>>\n>> SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk\n>> SVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch\n>\n> That's unfortunate.  There are many things that git-svn does to try to\n> avoid this happening.  You can fix it using the .git/info/grafts\n> facility - check the Documentation/ for information on that.  Once\n> you've got it looking right, git filter-branch can be used to make it\n> permanent, though you should certainly delete the git-svn metadata after\n> using that.\n\nDocumentation/repository-layout.txt had the best info on grafts.  A few \ngraft lines and my git repo looks just right.  For now, I'm scared of \nbreaking git-svn again; filter-branch can wait for later.\n\nThanks again,\nDaniel\n"}]}