{"thread":{"id":"15557","subject":"Getting correct tree layout when importing svn repo into git","startedAt":"2008-09-16T22:05:24Z","lastAt":"2008-09-17T13:04:28Z","messageCount":17,"participants":["Michael Kerrisk","Dmitry Potapov","Andreas Ericsson","Michael J Gruber","Michael Gebetsroither","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"90868","messageId":"cfd18e0f0809161505g4c04bd88vaf4fd7c40f67b243@mail.gmail.com","threadId":"15557","inReplyTo":null,"subject":"Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"mtk.manpages@googlemail.com","sentAt":"2008-09-16T22:05:24Z","receivedAt":"2008-09-16T22:05:24Z","isPatch":false,"sender":{"key":"mtk.manpages@googlemail.com","avatar":null},"body":"Hello,\n\nI'm currently trying to import an svn repository, along with its tags,\ninto git, and everything seems okay except that after the import I\nexpect to have the following structure to my checked out repository:\n\n    [root-dir]\n        .git\n        <checked-out-files>\n\nBut instead I end up with\n\n    [root-dir]\n        .git\n        man-pages               <-- name of my svn project\n            <checked-out-files>\n\nI've tried out a few different command-line flag settings but so far I\nhaven't managed to get the desired layout.  I guess that I'm missing\nsomething trivial, but I haven't worked out what it is so far.\n\nThe commands I'm using to do the import are:\n\n$ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n$ git svn fetch\n\nThe svn tags are getting imported okay, since:\n\ngit branch -a | head\n  tags/man-pages-2.00\n  tags/man-pages-2.01\n  ...\n  tags/man-pages-3.08\n  tags/man-pages-3.09\n  trunk\n\nThe following commands show the layout of my svn repo, which is pretty\nmuch standard:\n\n$ svn list file:///home/mtk/man-pages-rep\nbranches/\ntags/\ntrunk/\n$ svn list file:///home/mtk/man-pages-rep/trunk\nman-pages/\n$ svn list file:///home/mtk/man-pages-rep/trunk/man-pages\nChanges\nChanges.old\nMakefile\nREADME\nman-pages-3.09.Announce\n...\nman7/\nman8/\nscripts/\n$ svn list file:///home/mtk/man-pages-rep/tags\nman-pages-2.00/\nman-pages-2.01/\n...\nman-pages-3.08/\nman-pages-3.09/\n\nWhat 'git svn init' command do I need to get the layout that I want\nfor my imported git repo?\n\nCheers,\n\nMichael\n"},{"id":"90873","messageId":"37fcd2780809161620v38d9ade0sc1a2715f79501c6f@mail.gmail.com","threadId":"15557","inReplyTo":"cfd18e0f0809161505g4c04bd88vaf4fd7c40f67b243@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2008-09-16T23:20:26Z","receivedAt":"2008-09-16T23:20:26Z","isPatch":false,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"On Wed, Sep 17, 2008 at 2:05 AM, Michael Kerrisk\n<mtk.manpages@googlemail.com> wrote:\n>\n> I'm currently trying to import an svn repository, along with its tags,\n> into git, and everything seems okay except that after the import I\n> expect to have the following structure to my checked out repository:\n>\n>    [root-dir]\n>        .git\n>        <checked-out-files>\n>\n> But instead I end up with\n>\n>    [root-dir]\n>        .git\n>        man-pages               <-- name of my svn project\n>            <checked-out-files>\n>\n> I've tried out a few different command-line flag settings but so far I\n> haven't managed to get the desired layout.  I guess that I'm missing\n> something trivial, but I haven't worked out what it is so far.\n>\n> The commands I'm using to do the import are:\n>\n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n\nProbably, you want to run:\n\n$ git svn init file:///home/mtk/man-pages-rep/ -t tags -T\ntrunk/man-pages -b branches\n\nDmitry\n"},{"id":"90880","messageId":"c49095e30809161640o21cb89b7x17a9ac1b5b18054f@mail.gmail.com","threadId":"15557","inReplyTo":"37fcd2780809161620v38d9ade0sc1a2715f79501c6f@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"michael.kerrisk@googlemail.com","sentAt":"2008-09-16T23:40:36Z","receivedAt":"2008-09-16T23:40:36Z","isPatch":false,"sender":{"key":"michael.kerrisk@googlemail.com","avatar":null},"body":"Hello Dmitry,\n\nOn Wed, Sep 17, 2008 at 1:20 AM, Dmitry Potapov <dpotapov@gmail.com> wrote:\n> On Wed, Sep 17, 2008 at 2:05 AM, Michael Kerrisk\n> <mtk.manpages@googlemail.com> wrote:\n>>\n>> I'm currently trying to import an svn repository, along with its tags,\n>> into git, and everything seems okay except that after the import I\n>> expect to have the following structure to my checked out repository:\n>>\n>>    [root-dir]\n>>        .git\n>>        <checked-out-files>\n>>\n>> But instead I end up with\n>>\n>>    [root-dir]\n>>        .git\n>>        man-pages               <-- name of my svn project\n>>            <checked-out-files>\n>>\n>> I've tried out a few different command-line flag settings but so far I\n>> haven't managed to get the desired layout.  I guess that I'm missing\n>> something trivial, but I haven't worked out what it is so far.\n>>\n>> The commands I'm using to do the import are:\n>>\n>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>\n> Probably, you want to run:\n>\n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T\n> trunk/man-pages -b branches\n\nI had wondered about this.  And I haven't yet had a chance to verify\nthe result.  The reason is that whereas the command:\n\n$ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n\ntakes about half an hour to run, the other command (which I already\nstarted yesterday) seems to be taking (far) more than a day!\nTherefore, so far, I have not had a chance to run the command to\ncompletion to see if it gives the desired result.  The greatly\nincreased tun time also made me suspicious about whether the command\nwas going to do the right thing.  And, I end up with a lot of strange\nlooking tags in the (as yet incompletely) imported tree:\n\n$ git branch -a\n  tags/man-pages-2.00\n  tags/man-pages-2.00@117\n  tags/man-pages-2.01\n  tags/man-pages-2.01@145\n  tags/man-pages-2.02\n  tags/man-pages-2.02@184\n  tags/man-pages-2.03\n  tags/man-pages-2.03@232\n  tags/man-pages-2.04\n  tags/man-pages-2.04@283\n\nWhat are the @nnn tags about?\n\nBy tomorrow, probably the command will complete and I can see whether\nit produces the desired result.  But why does it take so much longer\nto run this version of the command?\n\nCheers,\n\nMichael\n"},{"id":"90893","messageId":"20080917011816.GL28210@dpotapov.dyndns.org","threadId":"15557","inReplyTo":"c49095e30809161640o21cb89b7x17a9ac1b5b18054f@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2008-09-17T01:18:16Z","receivedAt":"2008-09-17T01:18:16Z","isPatch":false,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"On Wed, Sep 17, 2008 at 01:40:36AM +0200, Michael Kerrisk wrote:\n> \n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n> \n> takes about half an hour to run, the other command (which I already\n> started yesterday) seems to be taking (far) more than a day!\n\nWhat version of Git do you use? If you use a version earlier than 1.5.6\nthan you can notice *considerable* speed up by upgrading to the latest\nversion of Git. Also, git-svn does not work well on Windows. Cygwin\nversion is slow due to fork(), and MSYS Git has some other issues with\nPerl. So, if you want to convert a huge SVN repo, it is better to do on\nLinux and using the latest version of Git. Perhaps, running on tmpfs may\nspeed up the process even more.\n\n> Therefore, so far, I have not had a chance to run the command to\n> completion to see if it gives the desired result.  The greatly\n> increased tun time also made me suspicious about whether the command\n> was going to do the right thing.  And, I end up with a lot of strange\n> looking tags in the (as yet incompletely) imported tree:\n> \n> $ git branch -a\n>   tags/man-pages-2.00\n>   tags/man-pages-2.00@117\n>   tags/man-pages-2.01\n>   tags/man-pages-2.01@145\n>   tags/man-pages-2.02\n>   tags/man-pages-2.02@184\n>   tags/man-pages-2.03\n>   tags/man-pages-2.03@232\n>   tags/man-pages-2.04\n>   tags/man-pages-2.04@283\n> \n> What are the @nnn tags about?\n\nI have never encounted them. Are you sure that you import into a clean\nGit repo?\n\nDmitry\n"},{"id":"90896","messageId":"c49095e30809162216m5c7885dbibbb022e65f43231c@mail.gmail.com","threadId":"15557","inReplyTo":"20080917011816.GL28210@dpotapov.dyndns.org","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"michael.kerrisk@googlemail.com","sentAt":"2008-09-17T05:16:09Z","receivedAt":"2008-09-17T05:16:09Z","isPatch":false,"sender":{"key":"michael.kerrisk@googlemail.com","avatar":null},"body":"Hi Dimitry,\n\nOn Tue, Sep 16, 2008 at 6:18 PM, Dmitry Potapov <dpotapov@gmail.com> wrote:\n> On Wed, Sep 17, 2008 at 01:40:36AM +0200, Michael Kerrisk wrote:\n>>\n>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>>\n>> takes about half an hour to run, the other command (which I already\n>> started yesterday) seems to be taking (far) more than a day!\n>\n> What version of Git do you use?\n\n1.5.4.5, on Linux.\n\n> If you use a version earlier than 1.5.6\n> than you can notice *considerable* speed up by upgrading to the latest\n\nHow much is \"considerable\"?  My import is *still* running.\n\n> version of Git. Also, git-svn does not work well on Windows. Cygwin\n> version is slow due to fork(), and MSYS Git has some other issues with\n> Perl. So, if you want to convert a huge SVN repo,\n\nMy svn repo is not huge.  5000 commits, 176MB.\n\n> it is better to do on\n> Linux and using the latest version of Git. Perhaps, running on tmpfs may\n> speed up the process even more.\n>\n>> Therefore, so far, I have not had a chance to run the command to\n>> completion to see if it gives the desired result.  The greatly\n>> increased tun time also made me suspicious about whether the command\n>> was going to do the right thing.  And, I end up with a lot of strange\n>> looking tags in the (as yet incompletely) imported tree:\n>>\n>> $ git branch -a\n>>   tags/man-pages-2.00\n>>   tags/man-pages-2.00@117\n>>   tags/man-pages-2.01\n>>   tags/man-pages-2.01@145\n>>   tags/man-pages-2.02\n>>   tags/man-pages-2.02@184\n>>   tags/man-pages-2.03\n>>   tags/man-pages-2.03@232\n>>   tags/man-pages-2.04\n>>   tags/man-pages-2.04@283\n>>\n>> What are the @nnn tags about?\n>\n> I have never encounted them. Are you sure that you import into a clean\n> Git repo?\n\nYes.  It's a clean repo in a new directory.\n\nCheers,\n\nMichael\n"},{"id":"90900","messageId":"48D0AA1A.5060209@op5.se","threadId":"15557","inReplyTo":"c49095e30809162216m5c7885dbibbb022e65f43231c@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-09-17T06:56:26Z","receivedAt":"2008-09-17T06:56:26Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Michael Kerrisk wrote:\n> Hi Dimitry,\n> \n> On Tue, Sep 16, 2008 at 6:18 PM, Dmitry Potapov <dpotapov@gmail.com> wrote:\n>> On Wed, Sep 17, 2008 at 01:40:36AM +0200, Michael Kerrisk wrote:\n>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>>>\n>>> takes about half an hour to run, the other command (which I already\n>>> started yesterday) seems to be taking (far) more than a day!\n>> What version of Git do you use?\n> \n> 1.5.4.5, on Linux.\n> \n\nAn upgrade would do you good.\n\n>> If you use a version earlier than 1.5.6\n>> than you can notice *considerable* speed up by upgrading to the latest\n> \n> How much is \"considerable\"?  My import is *still* running.\n> \n\nThe greatest factor will usually be network round trip time, so if\nthis is a one-shot conversion, rsync the repository to somewhere\nclose and run the import over a local network. I've had some \"fun\"\ntrying to import sourceforge svn repositories that were large-ish\nbut not huge (same seat you're in, basically), but since I get up\nto 800ms round trip time from sweden, conversion took forever.\n\n>>\n>>> Therefore, so far, I have not had a chance to run the command to\n>>> completion to see if it gives the desired result.  The greatly\n>>> increased tun time also made me suspicious about whether the command\n>>> was going to do the right thing.  And, I end up with a lot of strange\n>>> looking tags in the (as yet incompletely) imported tree:\n>>>\n>>> $ git branch -a\n>>>   tags/man-pages-2.00\n>>>   tags/man-pages-2.00@117\n>>>   tags/man-pages-2.01\n>>>   tags/man-pages-2.01@145\n>>>   tags/man-pages-2.02\n>>>   tags/man-pages-2.02@184\n>>>   tags/man-pages-2.03\n>>>   tags/man-pages-2.03@232\n>>>   tags/man-pages-2.04\n>>>   tags/man-pages-2.04@283\n>>>\n>>> What are the @nnn tags about?\n>> I have never encounted them. Are you sure that you import into a clean\n>> Git repo?\n> \n> Yes.  It's a clean repo in a new directory.\n> \n\nI've seen such tags before. They were added by an automatic build bot\nas a marker to say \"hey, I just built this\".\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"90905","messageId":"48D0BEF1.10008@drmicha.warpmail.net","threadId":"15557","inReplyTo":"cfd18e0f0809161505g4c04bd88vaf4fd7c40f67b243@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2008-09-17T08:25:21Z","receivedAt":"2008-09-17T08:25:21Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael Kerrisk venit, vidit, dixit 17.09.2008 00:05:\n> Hello,\n> \n> I'm currently trying to import an svn repository, along with its tags,\n> into git, and everything seems okay except that after the import I\n> expect to have the following structure to my checked out repository:\n> \n>     [root-dir]\n>         .git\n>         <checked-out-files>\n> \n> But instead I end up with\n> \n>     [root-dir]\n>         .git\n>         man-pages               <-- name of my svn project\n>             <checked-out-files>\n> \n> I've tried out a few different command-line flag settings but so far I\n> haven't managed to get the desired layout.  I guess that I'm missing\n> something trivial, but I haven't worked out what it is so far.\n> \n> The commands I'm using to do the import are:\n> \n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n> $ git svn fetch\n> \n> The svn tags are getting imported okay, since:\n> \n> git branch -a | head\n>   tags/man-pages-2.00\n>   tags/man-pages-2.01\n>   ...\n>   tags/man-pages-3.08\n>   tags/man-pages-3.09\n>   trunk\n> \n> The following commands show the layout of my svn repo, which is pretty\n> much standard:\n> \n> $ svn list file:///home/mtk/man-pages-rep\n> branches/\n> tags/\n> trunk/\n> $ svn list file:///home/mtk/man-pages-rep/trunk\n> man-pages/\n\nThat's the part that says that your layout is non-standard. What do your\n branches and tags look like? Do they have that superfluous \"man-pages\"\npart as well?\n\n> $ svn list file:///home/mtk/man-pages-rep/trunk/man-pages\n> Changes\n> Changes.old\n> Makefile\n> README\n> man-pages-3.09.Announce\n> ...\n> man7/\n> man8/\n> scripts/\n> $ svn list file:///home/mtk/man-pages-rep/tags\n> man-pages-2.00/\n> man-pages-2.01/\n> ...\n> man-pages-3.08/\n> man-pages-3.09/\n> \n> What 'git svn init' command do I need to get the layout that I want\n> for my imported git repo?\n\nIt depends on the structure of your branches and tags. My guess would be\nthat you have something like tags/man-pages-2.00/man-pages/ etc., in\nwhich case you would need a special configuration if you want to get rid\nof the \"man-pages\" part. Tells us your structure, we'll tell you the\nconfig ;)\n\nAlso, updating your git is strongly advised, but unrelated to the\nproblem at hand.\n\nMichael\n"},{"id":"90913","messageId":"cfd18e0f0809170328pb039331m1c4dc42fd398a4d@mail.gmail.com","threadId":"15557","inReplyTo":"48D0AA1A.5060209@op5.se","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"mtk.manpages@googlemail.com","sentAt":"2008-09-17T10:28:46Z","receivedAt":"2008-09-17T10:28:46Z","isPatch":false,"sender":{"key":"mtk.manpages@googlemail.com","avatar":null},"body":"Hi Andreas,\n\nOn Tue, Sep 16, 2008 at 11:56 PM, Andreas Ericsson <ae@op5.se> wrote:\n> Michael Kerrisk wrote:\n>>\n>> Hi Dimitry,\n>>\n>> On Tue, Sep 16, 2008 at 6:18 PM, Dmitry Potapov <dpotapov@gmail.com>\n>> wrote:\n>>>\n>>> On Wed, Sep 17, 2008 at 01:40:36AM +0200, Michael Kerrisk wrote:\n>>>>\n>>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b\n>>>> branches\n>>>>\n>>>> takes about half an hour to run, the other command (which I already\n>>>> started yesterday) seems to be taking (far) more than a day!\n>>>\n>>> What version of Git do you use?\n>>\n>> 1.5.4.5, on Linux.\n>>\n>\n> An upgrade would do you good.\n\nBut, is it going to make this much difference to the run time?  By\nnow, the import using\n\n$ git svn init file:///home/mtk/man-pages-rep/ -t tags -T\ntrunk/man-pages -b branches\n\nhas been running for over 2 days (and I still don't know if it will\ngive the layout I want), and seems to be slowing down exponentially as\nit gets further along in the import process, so at this rate it looks\nlike it would take several more days to complete, whereas\n\n$ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n\nwhich doesn't give the layout I want, takes less than an hour.  We're\ntalking about a factor of at least 100 x in the speed difference for\nthe two imports.\n\n>>> If you use a version earlier than 1.5.6\n>>> than you can notice *considerable* speed up by upgrading to the latest\n>>\n>> How much is \"considerable\"?  My import is *still* running.\n>>\n>\n> The greatest factor will usually be network round trip time, so if\n> this is a one-shot conversion, rsync the repository to somewhere\n> close and run the import over a local network. I've had some \"fun\"\n> trying to import sourceforge svn repositories that were large-ish\n> but not huge (same seat you're in, basically), but since I get up\n> to 800ms round trip time from sweden, conversion took forever.\n\nPerhaps I should have stated earleir, that the import is from a local\nsvn repo (note the 'file:///' in the 'git svn init'...).  176 MB, land\nless than 5000 commits.\n\nCheers,\n\nMichael\n\n>>>> Therefore, so far, I have not had a chance to run the command to\n>>>> completion to see if it gives the desired result.  The greatly\n>>>> increased tun time also made me suspicious about whether the command\n>>>> was going to do the right thing.  And, I end up with a lot of strange\n>>>> looking tags in the (as yet incompletely) imported tree:\n>>>>\n>>>> $ git branch -a\n>>>>  tags/man-pages-2.00\n>>>>  tags/man-pages-2.00@117\n>>>>  tags/man-pages-2.01\n>>>>  tags/man-pages-2.01@145\n>>>>  tags/man-pages-2.02\n>>>>  tags/man-pages-2.02@184\n>>>>  tags/man-pages-2.03\n>>>>  tags/man-pages-2.03@232\n>>>>  tags/man-pages-2.04\n>>>>  tags/man-pages-2.04@283\n>>>>\n>>>> What are the @nnn tags about?\n>>>\n>>> I have never encounted them. Are you sure that you import into a clean\n>>> Git repo?\n>>\n>> Yes.  It's a clean repo in a new directory.\n>>\n>\n> I've seen such tags before. They were added by an automatic build bot\n> as a marker to say \"hey, I just built this\".\n>\n> --\n> Andreas Ericsson                   andreas.ericsson@op5.se\n> OP5 AB                             www.op5.se\n> Tel: +46 8-230225                  Fax: +46 8-230231\n>\n\n\n\n-- \nMichael Kerrisk\nLinux man-pages maintainer; http://www.kernel.org/doc/man-pages/\nman-pages online: http://www.kernel.org/doc/man-pages/online_pages.html\nFound a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html\n"},{"id":"90914","messageId":"cfd18e0f0809170338v168c2991ma3964392e44e0194@mail.gmail.com","threadId":"15557","inReplyTo":"48D0BEF1.10008@drmicha.warpmail.net","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"mtk.manpages@googlemail.com","sentAt":"2008-09-17T10:38:12Z","receivedAt":"2008-09-17T10:38:12Z","isPatch":false,"sender":{"key":"mtk.manpages@googlemail.com","avatar":null},"body":"Hello Michael,\n\nOn Wed, Sep 17, 2008 at 1:25 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Michael Kerrisk venit, vidit, dixit 17.09.2008 00:05:\n>> Hello,\n>>\n>> I'm currently trying to import an svn repository, along with its tags,\n>> into git, and everything seems okay except that after the import I\n>> expect to have the following structure to my checked out repository:\n>>\n>>     [root-dir]\n>>         .git\n>>         <checked-out-files>\n>>\n>> But instead I end up with\n>>\n>>     [root-dir]\n>>         .git\n>>         man-pages               <-- name of my svn project\n>>             <checked-out-files>\n>>\n>> I've tried out a few different command-line flag settings but so far I\n>> haven't managed to get the desired layout.  I guess that I'm missing\n>> something trivial, but I haven't worked out what it is so far.\n>>\n>> The commands I'm using to do the import are:\n>>\n>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>> $ git svn fetch\n>>\n>> The svn tags are getting imported okay, since:\n>>\n>> git branch -a | head\n>>   tags/man-pages-2.00\n>>   tags/man-pages-2.01\n>>   ...\n>>   tags/man-pages-3.08\n>>   tags/man-pages-3.09\n>>   trunk\n>>\n>> The following commands show the layout of my svn repo, which is pretty\n>> much standard:\n>>\n>> $ svn list file:///home/mtk/man-pages-rep\n>> branches/\n>> tags/\n>> trunk/\n>> $ svn list file:///home/mtk/man-pages-rep/trunk\n>> man-pages/\n>\n> That's the part that says that your layout is non-standard. What do your\n>  branches and tags look like? Do they have that superfluous \"man-pages\"\n> part as well?\n\n$ svn list file:///home/mtk/man-pages-rep/tags\nman-pages-2.00\nman-pages-2.01\nman-pages-2.02\nman-pages-2.03\n...\n$ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.00\nman-pages\n$ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.01\nman-pages\n[and so on]\n$ svn list file:///home/mtk/man-pages-rep/branches\n$\n(i.e., no branches, since this has been a linear svn repo.)\n\n>> $ svn list file:///home/mtk/man-pages-rep/trunk/man-pages\n>> Changes\n>> Changes.old\n>> Makefile\n>> README\n>> man-pages-3.09.Announce\n>> ...\n>> man7/\n>> man8/\n>> scripts/\n>> $ svn list file:///home/mtk/man-pages-rep/tags\n>> man-pages-2.00/\n>> man-pages-2.01/\n>> ...\n>> man-pages-3.08/\n>> man-pages-3.09/\n>>\n>> What 'git svn init' command do I need to get the layout that I want\n>> for my imported git repo?\n>\n> It depends on the structure of your branches and tags. My guess would be\n> that you have something like tags/man-pages-2.00/man-pages/ etc., in\n> which case you would need a special configuration if you want to get rid\n> of the \"man-pages\" part. Tells us your structure, we'll tell you the\n> config ;)\n\nDo you now have enough info above?\n\nThanks,\n\nMichael\n\n-- \nMichael Kerrisk\nLinux man-pages maintainer; http://www.kernel.org/doc/man-pages/\nman-pages online: http://www.kernel.org/doc/man-pages/online_pages.html\nFound a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html\n"},{"id":"90915","messageId":"gaqmu0$4cf$1@ger.gmane.org","threadId":"15557","inReplyTo":"cfd18e0f0809170328pb039331m1c4dc42fd398a4d@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Gebetsroither","fromEmail":"gebi@sbox.tugraz.at","sentAt":"2008-09-17T10:42:08Z","receivedAt":"2008-09-17T10:42:08Z","isPatch":false,"sender":{"key":"gebi@sbox.tugraz.at","avatar":"https://gravatar.com/avatar/b3168bab3f94cb1f09343b408b618ff2982aea3c20789c387f6d5c9b3b73999b?d=mp&s=160"},"body":"* Michael Kerrisk <mtk.manpages@googlemail.com> wrote:\n\n> But, is it going to make this much difference to the run time?  By\n> now, the import using\n>\n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T\n> trunk/man-pages -b branches\n>\n> has been running for over 2 days (and I still don't know if it will\n> give the layout I want), and seems to be slowing down exponentially as\n> it gets further along in the import process, so at this rate it looks\n> like it would take several more days to complete, whereas\n\ngit-svn conversions are _much_ faster here if done on tmpfs with\noccasional git gc runs (in parallel).\n\nMay be the fault of the xfs.\n\ncu,\nmichael\n-- \nIt's already too late!\n"},{"id":"90918","messageId":"20080917105620.GA13144@atjola.homenet","threadId":"15557","inReplyTo":"cfd18e0f0809170328pb039331m1c4dc42fd398a4d@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-09-17T10:56:20Z","receivedAt":"2008-09-17T10:56:20Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.09.17 03:28:46 -0700, Michael Kerrisk wrote:\n> Hi Andreas,\n> \n> On Tue, Sep 16, 2008 at 11:56 PM, Andreas Ericsson <ae@op5.se> wrote:\n> > Michael Kerrisk wrote:\n> >>\n> >> Hi Dimitry,\n> >>\n> >> On Tue, Sep 16, 2008 at 6:18 PM, Dmitry Potapov <dpotapov@gmail.com>\n> >> wrote:\n> >>>\n> >>> On Wed, Sep 17, 2008 at 01:40:36AM +0200, Michael Kerrisk wrote:\n> >>>>\n> >>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b\n> >>>> branches\n> >>>>\n> >>>> takes about half an hour to run, the other command (which I already\n> >>>> started yesterday) seems to be taking (far) more than a day!\n> >>>\n> >>> What version of Git do you use?\n> >>\n> >> 1.5.4.5, on Linux.\n> >>\n> >\n> > An upgrade would do you good.\n> \n> But, is it going to make this much difference to the run time?  By\n> now, the import using\n\nIt should.\n\n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T\n> trunk/man-pages -b branches\n> \n> has been running for over 2 days (and I still don't know if it will\n> give the layout I want), and seems to be slowing down exponentially as\n> it gets further along in the import process, so at this rate it looks\n> like it would take several more days to complete, whereas\n> \n> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n> \n> which doesn't give the layout I want, takes less than an hour.  We're\n> talking about a factor of at least 100 x in the speed difference for\n> the two imports.\n\nI guess your old import doesn't see any relations between the trunk and\nthe tags/branches, right? Then the huge increase in runtime would be, at\nleast in part, explained by git-svn searching for ancestry. That you see\nthose tags/1.2.3@123 things also means that the 1.2.3 tags got deleted\nand recreated, or at least git-svn thinks so. Maybe the ancestry\ndetection goes nuts, hard to tell.\n\nIs that svn repo available anywhere?\n\nBjörn\n"},{"id":"90919","messageId":"20080917110510.GB13144@atjola.homenet","threadId":"15557","inReplyTo":"cfd18e0f0809170338v168c2991ma3964392e44e0194@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-09-17T11:05:10Z","receivedAt":"2008-09-17T11:05:10Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.09.17 03:38:12 -0700, Michael Kerrisk wrote:\n> $ svn list file:///home/mtk/man-pages-rep/tags\n> man-pages-2.00\n> man-pages-2.01\n> man-pages-2.02\n> man-pages-2.03\n> ...\n> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.00\n> man-pages\n> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.01\n> man-pages\n> [and so on]\n> $ svn list file:///home/mtk/man-pages-rep/branches\n> $\n> (i.e., no branches, since this has been a linear svn repo.)\n\nThat means that you also need to pass the \"man-pages\" suffix for the\ntags and branches.\n\ngit svn clone file:///path/to/repo \\\n\t-T trunk/man-pages \\\n\t-b branches/*/man-pages \\\n\t-t tags/*/man-pages\n\nMight require a more recent git-svn version, not sure about that.\n\nBjörn\n"},{"id":"90922","messageId":"48D0E6A3.4040703@drmicha.warpmail.net","threadId":"15557","inReplyTo":"cfd18e0f0809170338v168c2991ma3964392e44e0194@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2008-09-17T11:14:43Z","receivedAt":"2008-09-17T11:14:43Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael Kerrisk venit, vidit, dixit 17.09.2008 12:38:\n> Hello Michael,\n> \n> On Wed, Sep 17, 2008 at 1:25 AM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Michael Kerrisk venit, vidit, dixit 17.09.2008 00:05:\n>>> Hello,\n>>>\n>>> I'm currently trying to import an svn repository, along with its tags,\n>>> into git, and everything seems okay except that after the import I\n>>> expect to have the following structure to my checked out repository:\n>>>\n>>>     [root-dir]\n>>>         .git\n>>>         <checked-out-files>\n>>>\n>>> But instead I end up with\n>>>\n>>>     [root-dir]\n>>>         .git\n>>>         man-pages               <-- name of my svn project\n>>>             <checked-out-files>\n>>>\n>>> I've tried out a few different command-line flag settings but so far I\n>>> haven't managed to get the desired layout.  I guess that I'm missing\n>>> something trivial, but I haven't worked out what it is so far.\n>>>\n>>> The commands I'm using to do the import are:\n>>>\n>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>>> $ git svn fetch\n>>>\n>>> The svn tags are getting imported okay, since:\n>>>\n>>> git branch -a | head\n>>>   tags/man-pages-2.00\n>>>   tags/man-pages-2.01\n>>>   ...\n>>>   tags/man-pages-3.08\n>>>   tags/man-pages-3.09\n>>>   trunk\n>>>\n>>> The following commands show the layout of my svn repo, which is pretty\n>>> much standard:\n>>>\n>>> $ svn list file:///home/mtk/man-pages-rep\n>>> branches/\n>>> tags/\n>>> trunk/\n>>> $ svn list file:///home/mtk/man-pages-rep/trunk\n>>> man-pages/\n>> That's the part that says that your layout is non-standard. What do your\n>>  branches and tags look like? Do they have that superfluous \"man-pages\"\n>> part as well?\n> \n> $ svn list file:///home/mtk/man-pages-rep/tags\n> man-pages-2.00\n> man-pages-2.01\n> man-pages-2.02\n> man-pages-2.03\n> ...\n> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.00\n> man-pages\n> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.01\n> man-pages\n> [and so on]\n\nBingo!\n\n> $ svn list file:///home/mtk/man-pages-rep/branches\n> $\n> (i.e., no branches, since this has been a linear svn repo.)\n\ngit-svn converts svn tags into git branches (because they can change).\nSo you will get a git repo with lots of branches which are subsets (HEAD\ncommit is in master/trunk) of master/trunk.\n\n>>> $ svn list file:///home/mtk/man-pages-rep/trunk/man-pages\n>>> Changes\n>>> Changes.old\n>>> Makefile\n>>> README\n>>> man-pages-3.09.Announce\n>>> ...\n>>> man7/\n>>> man8/\n>>> scripts/\n>>> $ svn list file:///home/mtk/man-pages-rep/tags\n>>> man-pages-2.00/\n>>> man-pages-2.01/\n>>> ...\n>>> man-pages-3.08/\n>>> man-pages-3.09/\n>>>\n>>> What 'git svn init' command do I need to get the layout that I want\n>>> for my imported git repo?\n>> It depends on the structure of your branches and tags. My guess would be\n>> that you have something like tags/man-pages-2.00/man-pages/ etc., in\n>> which case you would need a special configuration if you want to get rid\n>> of the \"man-pages\" part. Tells us your structure, we'll tell you the\n>> config ;)\n> \n> Do you now have enough info above?\n\nYes, thanks. If you use git-svn init -s (which is equivalent to -T trunk\n-t tags -b branches) you get an \"exact\" clone of your svn repo in\nreasonable time, as you already noticed.\n\nIn order to get rid of the \"man-pages\" path component you can either:\n\n- remove it after the fact using git filter-branch\n\nor\n\n- remove it during the conversion process\n\nFor the latter, do the following:\n\ngit svn init -s file:///home/mtk/man-pages-rep/\n\nas usual. Then, before the first fetch, make sure your .git/config svn\nsection looks as follows:\n\n[svn-remote \"svn\"]\n        url = file:///home/mtk/man-pages-rep/\n        fetch = trunk/man-pages:refs/remotes/trunk\n        branches = branches/*/man-pages:refs/remotes/*\n        tags = tags/*/man-pages:refs/remotes/tags/*\n\nThat is, if you used \"git svn init -s\" you only have to add \"/man-pages\"\nthree times on the left hand side of the refspecs. You can also do this\nusing \"git config\", of course, if you watch out for the shell quoting.\n\nCheers,\nMichael\n"},{"id":"90936","messageId":"cfd18e0f0809170553j4b7d60c4gc9942458c2d93bc1@mail.gmail.com","threadId":"15557","inReplyTo":"20080917105620.GA13144@atjola.homenet","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"mtk.manpages@googlemail.com","sentAt":"2008-09-17T12:53:11Z","receivedAt":"2008-09-17T12:53:11Z","isPatch":false,"sender":{"key":"mtk.manpages@googlemail.com","avatar":null},"body":"Björn,\n\nOn Wed, Sep 17, 2008 at 3:56 AM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:\n> On 2008.09.17 03:28:46 -0700, Michael Kerrisk wrote:\n>> Hi Andreas,\n>>\n>> On Tue, Sep 16, 2008 at 11:56 PM, Andreas Ericsson <ae@op5.se> wrote:\n>> > Michael Kerrisk wrote:\n>> >>\n>> >> Hi Dimitry,\n>> >>\n>> >> On Tue, Sep 16, 2008 at 6:18 PM, Dmitry Potapov <dpotapov@gmail.com>\n>> >> wrote:\n>> >>>\n>> >>> On Wed, Sep 17, 2008 at 01:40:36AM +0200, Michael Kerrisk wrote:\n>> >>>>\n>> >>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b\n>> >>>> branches\n>> >>>>\n>> >>>> takes about half an hour to run, the other command (which I already\n>> >>>> started yesterday) seems to be taking (far) more than a day!\n>> >>>\n>> >>> What version of Git do you use?\n>> >>\n>> >> 1.5.4.5, on Linux.\n>> >>\n>> >\n>> > An upgrade would do you good.\n>>\n>> But, is it going to make this much difference to the run time?  By\n>> now, the import using\n>\n> It should.\n>\n>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T\n>> trunk/man-pages -b branches\n>>\n>> has been running for over 2 days (and I still don't know if it will\n>> give the layout I want), and seems to be slowing down exponentially as\n>> it gets further along in the import process, so at this rate it looks\n>> like it would take several more days to complete, whereas\n>>\n>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>>\n>> which doesn't give the layout I want, takes less than an hour.  We're\n>> talking about a factor of at least 100 x in the speed difference for\n>> the two imports.\n>\n> I guess your old import doesn't see any relations between the trunk and\n> the tags/branches, right? Then the huge increase in runtime would be, at\n> least in part, explained by git-svn searching for ancestry. That you see\n> those tags/1.2.3@123 things also means that the 1.2.3 tags got deleted\n> and recreated, or at least git-svn thinks so. Maybe the ancestry\n> detection goes nuts, hard to tell.\n\nThe above sounds very plausible as an explanation of what I'm seeing.\n\n> Is that svn repo available anywhere?\n\nIt's local.  If someone felt the need to look at it to see if there is\nsomething that could be improved in git (and maybe already is by the\ncurrent release), then I could put a copy somewhere.\n\nAnyway, it looks like I have a fix that works from someone else in the\nthread -- see my reply there.\n\nThanks!\n\nMichael\n\n-- \nMichael Kerrisk\nLinux man-pages maintainer; http://www.kernel.org/doc/man-pages/\nman-pages online: http://www.kernel.org/doc/man-pages/online_pages.html\nFound a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html\n"},{"id":"90937","messageId":"cfd18e0f0809170557n2aa6c290j69dafd412c92cc64@mail.gmail.com","threadId":"15557","inReplyTo":"20080917110510.GB13144@atjola.homenet","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"mtk.manpages@googlemail.com","sentAt":"2008-09-17T12:57:21Z","receivedAt":"2008-09-17T12:57:21Z","isPatch":false,"sender":{"key":"mtk.manpages@googlemail.com","avatar":null},"body":"Hi Björn,\n\nD'oh -- the fix was from you too ;-).  See below.\n\nOn Wed, Sep 17, 2008 at 4:05 AM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:\n> On 2008.09.17 03:38:12 -0700, Michael Kerrisk wrote:\n>> $ svn list file:///home/mtk/man-pages-rep/tags\n>> man-pages-2.00\n>> man-pages-2.01\n>> man-pages-2.02\n>> man-pages-2.03\n>> ...\n>> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.00\n>> man-pages\n>> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.01\n>> man-pages\n>> [and so on]\n>> $ svn list file:///home/mtk/man-pages-rep/branches\n>> $\n>> (i.e., no branches, since this has been a linear svn repo.)\n>\n> That means that you also need to pass the \"man-pages\" suffix for the\n> tags and branches.\n>\n> git svn clone file:///path/to/repo \\\n>        -T trunk/man-pages \\\n>        -b branches/*/man-pages \\\n>        -t tags/*/man-pages\n>\n> Might require a more recent git-svn version, not sure about that.\n\nUsing my current git version, this seems to produce the right result.\nThank you!  (I guess Michael's solution is essentially equivalent, but\nI tried yours first.)\n\nThanks everyone!\n\nCheers,\n\nMichael\n\n\n-- \nMichael Kerrisk\nLinux man-pages maintainer; http://www.kernel.org/doc/man-pages/\nman-pages online: http://www.kernel.org/doc/man-pages/online_pages.html\nFound a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html\n"},{"id":"90938","messageId":"cfd18e0f0809170600r79d883d3t96abb49e827d3178@mail.gmail.com","threadId":"15557","inReplyTo":"48D0E6A3.4040703@drmicha.warpmail.net","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael Kerrisk","fromEmail":"mtk.manpages@googlemail.com","sentAt":"2008-09-17T13:00:04Z","receivedAt":"2008-09-17T13:00:04Z","isPatch":false,"sender":{"key":"mtk.manpages@googlemail.com","avatar":null},"body":"Michael,\n\nOn Wed, Sep 17, 2008 at 4:14 AM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Michael Kerrisk venit, vidit, dixit 17.09.2008 12:38:\n>> Hello Michael,\n>>\n>> On Wed, Sep 17, 2008 at 1:25 AM, Michael J Gruber\n>> <git@drmicha.warpmail.net> wrote:\n>>> Michael Kerrisk venit, vidit, dixit 17.09.2008 00:05:\n>>>> Hello,\n>>>>\n>>>> I'm currently trying to import an svn repository, along with its tags,\n>>>> into git, and everything seems okay except that after the import I\n>>>> expect to have the following structure to my checked out repository:\n>>>>\n>>>>     [root-dir]\n>>>>         .git\n>>>>         <checked-out-files>\n>>>>\n>>>> But instead I end up with\n>>>>\n>>>>     [root-dir]\n>>>>         .git\n>>>>         man-pages               <-- name of my svn project\n>>>>             <checked-out-files>\n>>>>\n>>>> I've tried out a few different command-line flag settings but so far I\n>>>> haven't managed to get the desired layout.  I guess that I'm missing\n>>>> something trivial, but I haven't worked out what it is so far.\n>>>>\n>>>> The commands I'm using to do the import are:\n>>>>\n>>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>>>> $ git svn fetch\n>>>>\n>>>> The svn tags are getting imported okay, since:\n>>>>\n>>>> git branch -a | head\n>>>>   tags/man-pages-2.00\n>>>>   tags/man-pages-2.01\n>>>>   ...\n>>>>   tags/man-pages-3.08\n>>>>   tags/man-pages-3.09\n>>>>   trunk\n>>>>\n>>>> The following commands show the layout of my svn repo, which is pretty\n>>>> much standard:\n>>>>\n>>>> $ svn list file:///home/mtk/man-pages-rep\n>>>> branches/\n>>>> tags/\n>>>> trunk/\n>>>> $ svn list file:///home/mtk/man-pages-rep/trunk\n>>>> man-pages/\n>>> That's the part that says that your layout is non-standard. What do your\n>>>  branches and tags look like? Do they have that superfluous \"man-pages\"\n>>> part as well?\n>>\n>> $ svn list file:///home/mtk/man-pages-rep/tags\n>> man-pages-2.00\n>> man-pages-2.01\n>> man-pages-2.02\n>> man-pages-2.03\n>> ...\n>> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.00\n>> man-pages\n>> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.01\n>> man-pages\n>> [and so on]\n>\n> Bingo!\n>\n>> $ svn list file:///home/mtk/man-pages-rep/branches\n>> $\n>> (i.e., no branches, since this has been a linear svn repo.)\n>\n> git-svn converts svn tags into git branches (because they can change).\n> So you will get a git repo with lots of branches which are subsets (HEAD\n> commit is in master/trunk) of master/trunk.\n>\n>>>> $ svn list file:///home/mtk/man-pages-rep/trunk/man-pages\n>>>> Changes\n>>>> Changes.old\n>>>> Makefile\n>>>> README\n>>>> man-pages-3.09.Announce\n>>>> ...\n>>>> man7/\n>>>> man8/\n>>>> scripts/\n>>>> $ svn list file:///home/mtk/man-pages-rep/tags\n>>>> man-pages-2.00/\n>>>> man-pages-2.01/\n>>>> ...\n>>>> man-pages-3.08/\n>>>> man-pages-3.09/\n>>>>\n>>>> What 'git svn init' command do I need to get the layout that I want\n>>>> for my imported git repo?\n>>> It depends on the structure of your branches and tags. My guess would be\n>>> that you have something like tags/man-pages-2.00/man-pages/ etc., in\n>>> which case you would need a special configuration if you want to get rid\n>>> of the \"man-pages\" part. Tells us your structure, we'll tell you the\n>>> config ;)\n>>\n>> Do you now have enough info above?\n>\n> Yes, thanks. If you use git-svn init -s (which is equivalent to -T trunk\n> -t tags -b branches) you get an \"exact\" clone of your svn repo in\n> reasonable time, as you already noticed.\n>\n> In order to get rid of the \"man-pages\" path component you can either:\n>\n> - remove it after the fact using git filter-branch\n>\n> or\n>\n> - remove it during the conversion process\n>\n> For the latter, do the following:\n>\n> git svn init -s file:///home/mtk/man-pages-rep/\n>\n> as usual. Then, before the first fetch, make sure your .git/config svn\n> section looks as follows:\n>\n> [svn-remote \"svn\"]\n>        url = file:///home/mtk/man-pages-rep/\n>        fetch = trunk/man-pages:refs/remotes/trunk\n>        branches = branches/*/man-pages:refs/remotes/*\n>        tags = tags/*/man-pages:refs/remotes/tags/*\n\nI guess your solution here was equivalent to Björn's, since after I\ntried his suggestion, I ended up with an [svn-remote \"svn\"] that looks\njust as you describe.\n\nThanks,\n\nMichael\n\n> That is, if you used \"git svn init -s\" you only have to add \"/man-pages\"\n> three times on the left hand side of the refspecs. You can also do this\n> using \"git config\", of course, if you watch out for the shell quoting.\n>\n> Cheers,\n> Michael\n>\n\n\n\n-- \nMichael Kerrisk\nLinux man-pages maintainer; http://www.kernel.org/doc/man-pages/\nman-pages online: http://www.kernel.org/doc/man-pages/online_pages.html\nFound a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html\n"},{"id":"90939","messageId":"48D1005C.2090401@drmicha.warpmail.net","threadId":"15557","inReplyTo":"cfd18e0f0809170600r79d883d3t96abb49e827d3178@mail.gmail.com","subject":"Re: Getting correct tree layout when importing svn repo into git","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2008-09-17T13:04:28Z","receivedAt":"2008-09-17T13:04:28Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Michael Kerrisk venit, vidit, dixit 17.09.2008 15:00:\n> Michael,\n> \n> On Wed, Sep 17, 2008 at 4:14 AM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Michael Kerrisk venit, vidit, dixit 17.09.2008 12:38:\n>>> Hello Michael,\n>>>\n>>> On Wed, Sep 17, 2008 at 1:25 AM, Michael J Gruber\n>>> <git@drmicha.warpmail.net> wrote:\n>>>> Michael Kerrisk venit, vidit, dixit 17.09.2008 00:05:\n>>>>> Hello,\n>>>>>\n>>>>> I'm currently trying to import an svn repository, along with its tags,\n>>>>> into git, and everything seems okay except that after the import I\n>>>>> expect to have the following structure to my checked out repository:\n>>>>>\n>>>>>     [root-dir]\n>>>>>         .git\n>>>>>         <checked-out-files>\n>>>>>\n>>>>> But instead I end up with\n>>>>>\n>>>>>     [root-dir]\n>>>>>         .git\n>>>>>         man-pages               <-- name of my svn project\n>>>>>             <checked-out-files>\n>>>>>\n>>>>> I've tried out a few different command-line flag settings but so far I\n>>>>> haven't managed to get the desired layout.  I guess that I'm missing\n>>>>> something trivial, but I haven't worked out what it is so far.\n>>>>>\n>>>>> The commands I'm using to do the import are:\n>>>>>\n>>>>> $ git svn init file:///home/mtk/man-pages-rep/ -t tags -T trunk -b branches\n>>>>> $ git svn fetch\n>>>>>\n>>>>> The svn tags are getting imported okay, since:\n>>>>>\n>>>>> git branch -a | head\n>>>>>   tags/man-pages-2.00\n>>>>>   tags/man-pages-2.01\n>>>>>   ...\n>>>>>   tags/man-pages-3.08\n>>>>>   tags/man-pages-3.09\n>>>>>   trunk\n>>>>>\n>>>>> The following commands show the layout of my svn repo, which is pretty\n>>>>> much standard:\n>>>>>\n>>>>> $ svn list file:///home/mtk/man-pages-rep\n>>>>> branches/\n>>>>> tags/\n>>>>> trunk/\n>>>>> $ svn list file:///home/mtk/man-pages-rep/trunk\n>>>>> man-pages/\n>>>> That's the part that says that your layout is non-standard. What do your\n>>>>  branches and tags look like? Do they have that superfluous \"man-pages\"\n>>>> part as well?\n>>> $ svn list file:///home/mtk/man-pages-rep/tags\n>>> man-pages-2.00\n>>> man-pages-2.01\n>>> man-pages-2.02\n>>> man-pages-2.03\n>>> ...\n>>> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.00\n>>> man-pages\n>>> $ svn list file:///home/mtk/man-pages-rep/tags/man-pages-2.01\n>>> man-pages\n>>> [and so on]\n>> Bingo!\n>>\n>>> $ svn list file:///home/mtk/man-pages-rep/branches\n>>> $\n>>> (i.e., no branches, since this has been a linear svn repo.)\n>> git-svn converts svn tags into git branches (because they can change).\n>> So you will get a git repo with lots of branches which are subsets (HEAD\n>> commit is in master/trunk) of master/trunk.\n>>\n>>>>> $ svn list file:///home/mtk/man-pages-rep/trunk/man-pages\n>>>>> Changes\n>>>>> Changes.old\n>>>>> Makefile\n>>>>> README\n>>>>> man-pages-3.09.Announce\n>>>>> ...\n>>>>> man7/\n>>>>> man8/\n>>>>> scripts/\n>>>>> $ svn list file:///home/mtk/man-pages-rep/tags\n>>>>> man-pages-2.00/\n>>>>> man-pages-2.01/\n>>>>> ...\n>>>>> man-pages-3.08/\n>>>>> man-pages-3.09/\n>>>>>\n>>>>> What 'git svn init' command do I need to get the layout that I want\n>>>>> for my imported git repo?\n>>>> It depends on the structure of your branches and tags. My guess would be\n>>>> that you have something like tags/man-pages-2.00/man-pages/ etc., in\n>>>> which case you would need a special configuration if you want to get rid\n>>>> of the \"man-pages\" part. Tells us your structure, we'll tell you the\n>>>> config ;)\n>>> Do you now have enough info above?\n>> Yes, thanks. If you use git-svn init -s (which is equivalent to -T trunk\n>> -t tags -b branches) you get an \"exact\" clone of your svn repo in\n>> reasonable time, as you already noticed.\n>>\n>> In order to get rid of the \"man-pages\" path component you can either:\n>>\n>> - remove it after the fact using git filter-branch\n>>\n>> or\n>>\n>> - remove it during the conversion process\n>>\n>> For the latter, do the following:\n>>\n>> git svn init -s file:///home/mtk/man-pages-rep/\n>>\n>> as usual. Then, before the first fetch, make sure your .git/config svn\n>> section looks as follows:\n>>\n>> [svn-remote \"svn\"]\n>>        url = file:///home/mtk/man-pages-rep/\n>>        fetch = trunk/man-pages:refs/remotes/trunk\n>>        branches = branches/*/man-pages:refs/remotes/*\n>>        tags = tags/*/man-pages:refs/remotes/tags/*\n> \n> I guess your solution here was equivalent to Björn's, since after I\n> tried his suggestion, I ended up with an [svn-remote \"svn\"] that looks\n> just as you describe.\n> \n> Thanks,\n> \n> Michael\n\nYes. You mentioned you used an old version. Newer ones accept the\nparameters in the way Björn described. Older ones accepted the same\nconfig, just not as parameters.\n\nThat kind of config is well-suited for splitting large svn-repos which\nconsist of well-separated subprojects.\n\nSo, welcome among the happy svn->git converts ;)\n\nMichael\n\n>> That is, if you used \"git svn init -s\" you only have to add \"/man-pages\"\n>> three times on the left hand side of the refspecs. You can also do this\n>> using \"git config\", of course, if you watch out for the shell quoting.\n>>\n>> Cheers,\n>> Michael\n>>\n> \n> \n> \n"}]}