{"thread":{"id":"18317","subject":"git-svn: creating tags from a subdirectory of trunk","startedAt":"2009-03-15T21:18:41Z","lastAt":"2009-03-17T14:43:13Z","messageCount":5,"participants":["Tom Huybrechts","Eric Wong","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108057","messageId":"632a37a0903151418u483ca6cal1582518b9120da8e@mail.gmail.com","threadId":"18317","inReplyTo":null,"subject":"git-svn: creating tags from a subdirectory of trunk","fromName":"Tom Huybrechts","fromEmail":"tom.huybrechts@gmail.com","sentAt":"2009-03-15T21:18:41Z","receivedAt":"2009-03-15T21:18:41Z","isPatch":false,"sender":{"key":"tom.huybrechts@gmail.com","avatar":null},"body":"Hi,\n\nI'm trying to setup a git mirror of a svn repository.  The tags in\nthis repository are not created trunk it self, but from subdirectories\nof trunk. The tags and branches are in the standard places.\ne.g:\n/trunk/main -> tags/main-1\n/trunk/plugins/foo -> tags/foo-1\n/trunk/plugins/bar -> tags/bar-1\n\nI run 'git svn clone -s svn-url target'. It starts going over the\nhistory nicely until it reaches the first branch. It calls this branch\nsomething like tags/tag-name@revision, and starts retrieving the\nentire project history again from r1. This is repeated for every\nbranch.\n\nI've created a very small standalone shell script that demonstrates the problem:\n\n=====\n#!/bin/bash\n\nREPO=`pwd`/svn-repo\nWC=`pwd`/svn-wc\nsvnadmin create $REPO\nREPO=file://$REPO\nsvn co $REPO $WC\nSUBDIR=$WC/trunk/subdir\n\nmkdir $WC/tags $WC/trunk $WC/branches $SUBDIR\nsvn add $WC/*\nsvn commit -m \"structure\" $WC\nsvn cp -m \"create a tag\" $REPO/trunk/subdir $REPO/tags/1\n\ngit svn clone -s $REPO git-repo\n=====\n\n\nWhen you run this, the output of git-svn is:\n\n=====\nInitialized empty Git repository in /home/tom/experiment/git-repo/.git/\nW: +empty_dir: trunk/subdir\nr1 = 3b90e67a4d8e9a2d32d4389b0f6ac93e23f38a46 (trunk)\nFound possible branch point:\nfile:///home/tom/experiment/svn-repo/trunk/subdir =>\nfile:///home/tom/experiment/svn-repo/tags/1, 1\nInitializing parent: tags/1@1\nr1 = 0ad93ba4a7f6c43de30ab4dd05161662b75a6adb (tags/1@1)\nFound branch parent: (tags/1) 0ad93ba4a7f6c43de30ab4dd05161662b75a6adb\nFollowing parent with do_switch\nSuccessfully followed parent\nr2 = ce47fc7b4e21000c84da63ad5f643c18118d1918 (tags/1)\nChecked out HEAD:\n  file:///home/tom/experiment/svn-repo/tags/1 r2\n=====\n\nNote the tags/1@1 and then starting over again from r1.\n\nIt's not so bad in this little example, but try this on a repository\nwith  200 tags and 16000 revisions...\nSo my question: is this normal or a bug ? Can I do something to import\nthis repository correctly ?\n\nThanks,\n\nTom\n"},{"id":"108060","messageId":"20090315232105.GA21667@dcvr.yhbt.net","threadId":"18317","inReplyTo":"632a37a0903151418u483ca6cal1582518b9120da8e@mail.gmail.com","subject":"Re: git-svn: creating tags from a subdirectory of trunk","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-03-15T23:21:05Z","receivedAt":"2009-03-15T23:21:05Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Tom Huybrechts <tom.huybrechts@gmail.com> wrote:\n> Hi,\n> \n> I'm trying to setup a git mirror of a svn repository.  The tags in\n> this repository are not created trunk it self, but from subdirectories\n> of trunk. The tags and branches are in the standard places.\n> e.g:\n> /trunk/main -> tags/main-1\n> /trunk/plugins/foo -> tags/foo-1\n> /trunk/plugins/bar -> tags/bar-1\n> \n> I run 'git svn clone -s svn-url target'. It starts going over the\n> history nicely until it reaches the first branch. It calls this branch\n> something like tags/tag-name@revision, and starts retrieving the\n> entire project history again from r1. This is repeated for every\n> branch.\n\nHi Tom,\n\nThis is a known problem with some repositories.  My suggestion is to\nuse individual \"fetch\" directives for each of those tags you want to\nfollow.\n\nThe -s/--stdlayout is only for projects that follow the SVN-recommended\nrepository layout exactly and we haven't thought of a generic way to\nhandle those non-standard tags in repos...\n\n-- \nEric Wong\n"},{"id":"108110","messageId":"632a37a0903161202w23848f41g5cde3942195369cb@mail.gmail.com","threadId":"18317","inReplyTo":"20090315232105.GA21667@dcvr.yhbt.net","subject":"Re: git-svn: creating tags from a subdirectory of trunk","fromName":"Tom Huybrechts","fromEmail":"tom.huybrechts@gmail.com","sentAt":"2009-03-16T19:02:08Z","receivedAt":"2009-03-16T19:02:08Z","isPatch":false,"sender":{"key":"tom.huybrechts@gmail.com","avatar":null},"body":"On Mon, Mar 16, 2009 at 12:21 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> Tom Huybrechts <tom.huybrechts@gmail.com> wrote:\n>> Hi,\n>>\n>> I'm trying to setup a git mirror of a svn repository.  The tags in\n>> this repository are not created trunk it self, but from subdirectories\n>> of trunk. The tags and branches are in the standard places.\n>> e.g:\n>> /trunk/main -> tags/main-1\n>> /trunk/plugins/foo -> tags/foo-1\n>> /trunk/plugins/bar -> tags/bar-1\n>>\n>> I run 'git svn clone -s svn-url target'. It starts going over the\n>> history nicely until it reaches the first branch. It calls this branch\n>> something like tags/tag-name@revision, and starts retrieving the\n>> entire project history again from r1. This is repeated for every\n>> branch.\n>\n> Hi Tom,\n>\n> This is a known problem with some repositories.  My suggestion is to\n> use individual \"fetch\" directives for each of those tags you want to\n> follow.\n>\n> The -s/--stdlayout is only for projects that follow the SVN-recommended\n> repository layout exactly and we haven't thought of a generic way to\n> handle those non-standard tags in repos...\n>\n> --\n> Eric Wong\n>\n\nHi Eric,\n\nThe repository I'm trying to convert is that of Hudson. I did some\ndigging in the list archives, and found this came up earlier\n(2009/01/08).\nBack then you replied:\n\n\"\"\"\nAlternately, you could just clone the root and have all the branches all\nover the place in one tree (your eventually working copy will be huge).\n\n  git svn clone https://svn.dev.java.net/svn/hudson\n\n\nBasically this is the equivalent of:\n\n  svn co https://svn.dev.java.net/svn/hudson\n\nExcept you'll have the full history.\n\"\"\"\n\nIs that still valid ? That is what I did, and which caused the\nbehaviour I described.\n\nTom\n"},{"id":"108139","messageId":"20090316210856.GB19153@dcvr.yhbt.net","threadId":"18317","inReplyTo":"632a37a0903161202w23848f41g5cde3942195369cb@mail.gmail.com","subject":"Re: git-svn: creating tags from a subdirectory of trunk","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-03-16T21:08:56Z","receivedAt":"2009-03-16T21:08:56Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Tom Huybrechts <tom.huybrechts@gmail.com> wrote:\n> On Mon, Mar 16, 2009 at 12:21 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> > Tom Huybrechts <tom.huybrechts@gmail.com> wrote:\n> >> Hi,\n> >>\n> >> I'm trying to setup a git mirror of a svn repository.  The tags in\n> >> this repository are not created trunk it self, but from subdirectories\n> >> of trunk. The tags and branches are in the standard places.\n> >> e.g:\n> >> /trunk/main -> tags/main-1\n> >> /trunk/plugins/foo -> tags/foo-1\n> >> /trunk/plugins/bar -> tags/bar-1\n> >>\n> >> I run 'git svn clone -s svn-url target'. It starts going over the\n> >> history nicely until it reaches the first branch. It calls this branch\n> >> something like tags/tag-name@revision, and starts retrieving the\n> >> entire project history again from r1. This is repeated for every\n> >> branch.\n> >\n> > Hi Tom,\n> >\n> > This is a known problem with some repositories.  My suggestion is to\n> > use individual \"fetch\" directives for each of those tags you want to\n> > follow.\n> >\n> > The -s/--stdlayout is only for projects that follow the SVN-recommended\n> > repository layout exactly and we haven't thought of a generic way to\n> > handle those non-standard tags in repos...\n> >\n> > --\n> > Eric Wong\n> >\n> \n> Hi Eric,\n> \n> The repository I'm trying to convert is that of Hudson. I did some\n> digging in the list archives, and found this came up earlier\n> (2009/01/08).\n> Back then you replied:\n> \n> \"\"\"\n> Alternately, you could just clone the root and have all the branches all\n> over the place in one tree (your eventually working copy will be huge).\n> \n>   git svn clone https://svn.dev.java.net/svn/hudson\n> \n> \n> Basically this is the equivalent of:\n> \n>   svn co https://svn.dev.java.net/svn/hudson\n> \n> Except you'll have the full history.\n> \"\"\"\n> \n> Is that still valid ? That is what I did, and which caused the\n> behaviour I described.\n\nI did not use the -s/--stdlayout option in my example.\nBut yeah, either way that repository is nasty with git-svn :<\n\n-- \nEric Wong\n"},{"id":"108230","messageId":"49BFB701.3040800@drmicha.warpmail.net","threadId":"18317","inReplyTo":"632a37a0903151418u483ca6cal1582518b9120da8e@mail.gmail.com","subject":"Re: git-svn: creating tags from a subdirectory of trunk","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-17T14:43:13Z","receivedAt":"2009-03-17T14:43:13Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Tom Huybrechts venit, vidit, dixit 15.03.2009 22:18:\n> Hi,\n> \n> I'm trying to setup a git mirror of a svn repository.  The tags in\n> this repository are not created trunk it self, but from subdirectories\n> of trunk. The tags and branches are in the standard places.\n> e.g:\n> /trunk/main -> tags/main-1\n> /trunk/plugins/foo -> tags/foo-1\n> /trunk/plugins/bar -> tags/bar-1\n> \n> I run 'git svn clone -s svn-url target'. It starts going over the\n> history nicely until it reaches the first branch. It calls this branch\n> something like tags/tag-name@revision, and starts retrieving the\n> entire project history again from r1. This is repeated for every\n> branch.\n\nAnd I thought *I* had produced sick repos by abusing svn...\nThere are also such niceties as\n/trunk/trunk/\nin there.\n\nThe problem is that svn tags are branches (to the same extent that svn\nbranches are branches...) and git svn treats them as such, but the\nhudson tags contain only subtrees. I think you have two options:\n\n- Convert without tags, and try to assign real git tags later on based\non the output of svn log. (This assumes svn tags have not been abused as\nbranches.)\n\n- Setup git svn configs for each subproject individually, since the tags\ncontain only subproject tags.\n\nIt seems as though hudson's tags have not been abused as branches,\nexcept for some messing with deletes and recreations. So the first\napproach may be worthwhile.\n\nMichael\n"}]}