{"thread":{"id":"18267","subject":"After git svn clone master is tied to a branch in svn, howto set master to trunk","startedAt":"2009-03-11T15:17:04Z","lastAt":"2009-03-11T17:54:37Z","messageCount":5,"participants":["Svenn Are Bjerkem","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107698","messageId":"09fb20f5-3722-49d4-9565-95a5b41d15ac@c36g2000yqn.googlegroups.com","threadId":"18267","inReplyTo":null,"subject":"After git svn clone master is tied to a branch in svn, howto set master to trunk","fromName":"Svenn Are Bjerkem","fromEmail":"svenn.bjerkem@googlemail.com","sentAt":"2009-03-11T15:17:04Z","receivedAt":"2009-03-11T15:17:04Z","isPatch":false,"sender":{"key":"svenn.bjerkem@googlemail.com","avatar":null},"body":"Hi,\nafter performing a\n$> git svn clone https://svnserver/svn/a/b/c -T trunk/current -t tags -\nb branches\nI find that the git master has been tied to one of the branches. It\nturns out that the highest svn revision number in the repository was\ntied to that branch.\n\nFor historical reasons we have subdirectories in trunk/ on svn, but I\ninspected .git/config\n[svn-remote \"svn\"]\n        url = https://svnserver/svn\n        fetch = a/b/c/trunk/current:refs/remotes/trunk\n        branches = a/b/c/branches/*:refs/remotes/*\n        tags = a/b/c/tags/*:refs/remotes/tags/*\nAnd I assume it picked up the strange trunk correctly.\n\nI have been googling around for a while looking for instructions how\nto tell git that when I check out \"master\" it should be \"trunk\" from\nsvn and not \"branches/next_gen\", or more precisely how to move master\nto trunk from branches/next_gen.\n\nI guess I could solve the problem by modifying a file in trunk on svn\nand commit so that the trunk will get the highest svn revision number\nagain and redo the clone.\n\n--\nSvenn\n"},{"id":"107708","messageId":"7ec81af9-d5eb-42a4-b6af-22e7a3ab89f8@t7g2000yqa.googlegroups.com","threadId":"18267","inReplyTo":"09fb20f5-3722-49d4-9565-95a5b41d15ac@c36g2000yqn.googlegroups.com","subject":"Re: After git svn clone master is tied to a branch in svn, howto set master to trunk","fromName":"Svenn Are Bjerkem","fromEmail":"svenn.bjerkem@googlemail.com","sentAt":"2009-03-11T16:04:23Z","receivedAt":"2009-03-11T16:04:23Z","isPatch":false,"sender":{"key":"svenn.bjerkem@googlemail.com","avatar":null},"body":"On Mar 11, 4:17 pm, Svenn Are Bjerkem <svenn.bjer...@googlemail.com>\nwrote:\n> Hi,\n> after performing a\n> $> git svn clone https://svnserver/svn/a/b/c-T trunk/current -t tags -\n> b branches\n> I find that the git master has been tied to one of the branches. It\n> turns out that the highest svn revision number in the repository was\n> tied to that branch.\n\n[snip]\n\n> I guess I could solve the problem by modifying a file in trunk on svn\n> and commit so that the trunk will get the highest svn revision number\n> again and redo the clone.\n\nI just wanted to confirm this assumption: First I removed the complete\ngit-svn clone and modified a file in trunk and checked it into svn.\nThen I re-performed the git svn clone as described above. The master\nin the local git repository is now tied to the trunk of the svn\nrepository.\n\n--\nSvenn\n"},{"id":"107714","messageId":"49B7E7BB.2090803@drmicha.warpmail.net","threadId":"18267","inReplyTo":"09fb20f5-3722-49d4-9565-95a5b41d15ac@c36g2000yqn.googlegroups.com","subject":"Re: After git svn clone master is tied to a branch in svn, howto set master to trunk","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-11T16:32:59Z","receivedAt":"2009-03-11T16:32:59Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Svenn Are Bjerkem venit, vidit, dixit 11.03.2009 16:17:\n> Hi,\n> after performing a\n> $> git svn clone https://svnserver/svn/a/b/c -T trunk/current -t tags -\n> b branches\n> I find that the git master has been tied to one of the branches. It\n> turns out that the highest svn revision number in the repository was\n> tied to that branch.\n> \n> For historical reasons we have subdirectories in trunk/ on svn, but I\n> inspected .git/config\n> [svn-remote \"svn\"]\n>         url = https://svnserver/svn\n>         fetch = a/b/c/trunk/current:refs/remotes/trunk\n>         branches = a/b/c/branches/*:refs/remotes/*\n>         tags = a/b/c/tags/*:refs/remotes/tags/*\n> And I assume it picked up the strange trunk correctly.\n> \n> I have been googling around for a while looking for instructions how\n> to tell git that when I check out \"master\" it should be \"trunk\" from\n> svn and not \"branches/next_gen\", or more precisely how to move master\n> to trunk from branches/next_gen.\n> \n> I guess I could solve the problem by modifying a file in trunk on svn\n> and commit so that the trunk will get the highest svn revision number\n> again and redo the clone.\n\nI'm not quite sure what you mean by master being \"tied\" to an svn\nbranch. You mean you want master to track the svn trunk? Then\n\ngit branch -D master\ngit checkout --track -b master trunk\n\nshould do (assuming you haven't worked on master yet).\n\nMichael\n"},{"id":"107721","messageId":"f07e780b-621f-4d2d-83dd-363716f9d507@d19g2000yqb.googlegroups.com","threadId":"18267","inReplyTo":"49B7E7BB.2090803@drmicha.warpmail.net","subject":"Re: After git svn clone master is tied to a branch in svn, howto set master to trunk","fromName":"Svenn Are Bjerkem","fromEmail":"svenn.bjerkem@googlemail.com","sentAt":"2009-03-11T17:20:12Z","receivedAt":"2009-03-11T17:20:12Z","isPatch":false,"sender":{"key":"svenn.bjerkem@googlemail.com","avatar":null},"body":"On Mar 11, 5:32 pm, Michael J Gruber <g...@drmicha.warpmail.net>\nwrote:\n> Svenn Are Bjerkem venit, vidit, dixit 11.03.2009 16:17:\n>\n>\n>\n> > Hi,\n> > after performing a\n> > $> git svn clonehttps://svnserver/svn/a/b/c-T trunk/current -t tags -\n> > b branches\n> > I find that the git master has been tied to one of the branches. It\n> > turns out that the highest svn revision number in the repository was\n> > tied to that branch.\n>\n> > For historical reasons we have subdirectories in trunk/ on svn, but I\n> > inspected .git/config\n> > [svn-remote \"svn\"]\n> >         url =https://svnserver/svn\n> >         fetch = a/b/c/trunk/current:refs/remotes/trunk\n> >         branches = a/b/c/branches/*:refs/remotes/*\n> >         tags = a/b/c/tags/*:refs/remotes/tags/*\n> > And I assume it picked up the strange trunk correctly.\n>\n> > I have been googling around for a while looking for instructions how\n> > to tell git that when I check out \"master\" it should be \"trunk\" from\n> > svn and not \"branches/next_gen\", or more precisely how to move master\n> > to trunk from branches/next_gen.\n>\n> > I guess I could solve the problem by modifying a file in trunk on svn\n> > and commit so that the trunk will get the highest svn revision number\n> > again and redo the clone.\n>\n> I'm not quite sure what you mean by master being \"tied\" to an svn\n> branch. You mean you want master to track the svn trunk? Then\n\nWhen doing a git svn info in master right after the clone was\nfinished, before any work was done, URL was https://...../branches/next_gen.\nWhen deleting the git repository, modifying and commiting a file in\ntrunk on svn and rerun the exact same clone operation, URL in git svn\ninfo became https://....../trunk/current. During the first clone,\nbranches/next_gen had the highest overall svn revision number and got\nautomatically \"tied\" to master, while in the second clone run trunk\nhad the highest overall svn revision number and git chose that master\nshould track svn trunk.\n\n>\n> git branch -D master\n> git checkout --track -b master trunk\n>\n> should do (assuming you haven't worked on master yet).\n\nI will take a note of this advice and perform a commit to force a\ndifferent branch than next_gen to have overall highest svn revision\nnumber when I do a clone next time. Reading up in the manuals on your\nsuggestion seems to be what I intended to acheive.\n\nThanks,\n--\nSvenn\n"},{"id":"107722","messageId":"137694e3-7e06-49cd-b4d4-a3e2d9fc4560@v15g2000yqn.googlegroups.com","threadId":"18267","inReplyTo":"f07e780b-621f-4d2d-83dd-363716f9d507@d19g2000yqb.googlegroups.com","subject":"Re: After git svn clone master is tied to a branch in svn, howto set master to trunk","fromName":"Svenn Are Bjerkem","fromEmail":"svenn.bjerkem@googlemail.com","sentAt":"2009-03-11T17:54:37Z","receivedAt":"2009-03-11T17:54:37Z","isPatch":false,"sender":{"key":"svenn.bjerkem@googlemail.com","avatar":null},"body":"On Mar 11, 6:20 pm, Svenn Are Bjerkem <svenn.bjer...@googlemail.com>\nwrote:\n> On Mar 11, 5:32 pm, Michael J Gruber <g...@drmicha.warpmail.net>\n> wrote:\n>\n>\n>\n> > Svenn Are Bjerkem venit, vidit, dixit 11.03.2009 16:17:\n>\n> > > Hi,\n> > > after performing a\n> > > $> git svn clonehttps://svnserver/svn/a/b/c-Ttrunk/current -t tags -\n> > > b branches\n> > > I find that the git master has been tied to one of the branches. It\n> > > turns out that the highest svn revision number in the repository was\n> > > tied to that branch.\n>\n> > > For historical reasons we have subdirectories in trunk/ on svn, but I\n> > > inspected .git/config\n> > > [svn-remote \"svn\"]\n> > >         url =https://svnserver/svn\n> > >         fetch = a/b/c/trunk/current:refs/remotes/trunk\n> > >         branches = a/b/c/branches/*:refs/remotes/*\n> > >         tags = a/b/c/tags/*:refs/remotes/tags/*\n> > > And I assume it picked up the strange trunk correctly.\n>\n> > > I have been googling around for a while looking for instructions how\n> > > to tell git that when I check out \"master\" it should be \"trunk\" from\n> > > svn and not \"branches/next_gen\", or more precisely how to move master\n> > > to trunk from branches/next_gen.\n>\n> > > I guess I could solve the problem by modifying a file in trunk on svn\n> > > and commit so that the trunk will get the highest svn revision number\n> > > again and redo the clone.\n>\n> > I'm not quite sure what you mean by master being \"tied\" to an svn\n> > branch. You mean you want master to track the svn trunk? Then\n>\n> When doing a git svn info in master right after the clone was\n> finished, before any work was done, URL washttps://...../branches/next_gen.\n> When deleting the git repository, modifying and commiting a file in\n> trunk on svn and rerun the exact same clone operation, URL in git svn\n> info becamehttps://....../trunk/current. During the first clone,\n> branches/next_gen had the highest overall svn revision number and got\n> automatically \"tied\" to master, while in the second clone run trunk\n> had the highest overall svn revision number and git chose that master\n> should track svn trunk.\n>\n>\n>\n> > git branch -D master\n> > git checkout --track -b master trunk\n>\n> > should do (assuming you haven't worked on master yet).\n>\n> I will take a note of this advice and perform a commit to force a\n> different branch than next_gen to have overall highest svn revision\n> number when I do a clone next time. Reading up in the manuals on your\n> suggestion seems to be what I intended to acheive.\n\nI now had the opportunity to check your suggestion, and this time I\nfirst performed a commit in branches/old_gen so branches/old_gen got\nthe overall highest svn revision number. When performing exactly the\nsame git svn clone as before, master was set to track branches/\nold_gen. Now I tried your suggestion, and except for the fact that I\ncannot delete master as long as I am in master, it works as expected.\nI had to do a git checkout -b next_gen next_gen to get into next_gen\nbranch to be allowed to git branch -D master, but that was not a\nreally big surprise. Then checkout --track does the job nicely.\n\nGood to know, thanks for your help,\nSvenn\n"}]}