{"thread":{"id":"9519","subject":"[PATCH] Allow git-svnimport to take \"\" as the trunk directory.","startedAt":"2007-08-14T04:03:18Z","lastAt":"2007-08-14T13:33:47Z","messageCount":4,"participants":["Alberto Bertogli","David Kastrup","Leandro Lucarella"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"50673","messageId":"11870641981207-git-send-email-albertito@gmail.com","threadId":"9519","inReplyTo":null,"subject":"[PATCH] Allow git-svnimport to take \"\" as the trunk directory.","fromName":"Alberto Bertogli","fromEmail":"albertito@gmail.com","sentAt":"2007-08-14T04:03:18Z","receivedAt":"2007-08-14T04:03:18Z","isPatch":true,"sender":{"key":"albertito@gmail.com","avatar":null},"body":"Some repositories started with the trunk in \"/\" and then moved it to the\nstandard \"trunk/\" location.\n\nOn these repositories, the correct thing would be to call git-svnimport -T \"\",\nbut because of the way the options are handled, it uses the default \"trunk\"\ninstead of the given empty string. This patch fixes that behaviour.\n\nReported by Leandro Lucarella <llucax@gmail.com>.\n\nSigned-off-by: Alberto Bertogli <albertito@gmail.com>\n---\n\nWhile the same could be done for tags and branches, I don't think it makes\nmuch sense.\n\n\ngit-svnimport.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex b73d649..8c17fb5 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -49,7 +49,7 @@ getopts(\"A:b:C:dDFhiI:l:mM:o:rs:t:T:SP:R:uv\") or usage();\n usage if $opt_h;\n \n my $tag_name = $opt_t || \"tags\";\n-my $trunk_name = $opt_T || \"trunk\";\n+my $trunk_name = defined $opt_T ? $opt_T : \"trunk\";\n my $branch_name = $opt_b || \"branches\";\n my $project_name = $opt_P || \"\";\n $project_name = \"/\" . $project_name if ($project_name);\n-- \n1.5.3.rc4.67.gf9286-dirty\n"},{"id":"50680","messageId":"85vebi3bzv.fsf@lola.goethe.zz","threadId":"9519","inReplyTo":"11870641981207-git-send-email-albertito@gmail.com","subject":"Re: [PATCH] Allow git-svnimport to take \"\" as the trunk directory.","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-14T05:45:40Z","receivedAt":"2007-08-14T05:45:40Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Alberto Bertogli <albertito@gmail.com> writes:\n\n> Some repositories started with the trunk in \"/\" and then moved it to the\n> standard \"trunk/\" location.\n>\n> On these repositories, the correct thing would be to call\n> git-svnimport -T \"\",\n\nI would not call that the best solution: it makes the bad decision\nfrom the past impact useful work in the future.  I very much like git\nhaving a good toplevel directory structure.\n\nThere are two approaches possible: one is to version the mapping\ntrunk/tags/branches.  Another would be if one could tell git-svn where\nto stick stuff that does not sort into trunk/tags/branches.\nIncidentally, I've seen repositories that have something like a\n\"support\" or \"vendor\" directory, too.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"50702","messageId":"20070814123604.GA10472@homero.springfield.home","threadId":"9519","inReplyTo":"85vebi3bzv.fsf@lola.goethe.zz","subject":"Re: [PATCH] Allow git-svnimport to take \"\" as the trunk directory.","fromName":"Leandro Lucarella","fromEmail":"llucax@gmail.com","sentAt":"2007-08-14T12:36:04Z","receivedAt":"2007-08-14T12:36:04Z","isPatch":true,"sender":{"key":"llucax@gmail.com","avatar":null},"body":"David Kastrup, el 14 de agosto a las 07:45 me escribiste:\n> Alberto Bertogli <albertito@gmail.com> writes:\n> \n> > Some repositories started with the trunk in \"/\" and then moved it to the\n> > standard \"trunk/\" location.\n> >\n> > On these repositories, the correct thing would be to call\n> > git-svnimport -T \"\",\n> \n> I would not call that the best solution: it makes the bad decision\n> from the past impact useful work in the future.  I very much like git\n> having a good toplevel directory structure.\n\nBesides the example of a mutating trunk directory, I have repositories\nwhere there is only trunk (in \"/\" directory) and it never changes. Without\nthis patch, I can't even import that kind of repositories.\n\nWith repositories with a mutating trunk directory, I used the options -s\nand -l to incrementally import the repository. For example:\n$ git svnimport -l 100 -T '' <repo>\nand then\n$ git svnimport -s 101 -T 'trunk' <repo>\n\n> There are two approaches possible: one is to version the mapping\n> trunk/tags/branches.  Another would be if one could tell git-svn where\n> to stick stuff that does not sort into trunk/tags/branches.\n> Incidentally, I've seen repositories that have something like a\n> \"support\" or \"vendor\" directory, too.\n\nThe patch is for git-svnimport, not git-svn (but maybe git-svn has\nthe same problem). Anyways, a way to map trunk/tags/branches to different\ndirectories in different versions would be great, but is a different\nproblem than -T not supporting an empty string.\n\n-- \nLeandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/\n .------------------------------------------------------------------------,\n  \\  GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05 /\n   '--------------------------------------------------------------------'\nComo un rinoceronte que lleva un pájaro en el lomo,\nyo te alimento, no te veo ni te toco.\n"},{"id":"50703","messageId":"86ps1qfdfo.fsf@lola.quinscape.zz","threadId":"9519","inReplyTo":"20070814123604.GA10472@homero.springfield.home","subject":"Re: [PATCH] Allow git-svnimport to take \"\" as the trunk directory.","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-14T13:33:47Z","receivedAt":"2007-08-14T13:33:47Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Leandro Lucarella <llucax@gmail.com> writes:\n\n> David Kastrup, el 14 de agosto a las 07:45 me escribiste:\n>> Alberto Bertogli <albertito@gmail.com> writes:\n>> \n>> > Some repositories started with the trunk in \"/\" and then moved it to the\n>> > standard \"trunk/\" location.\n>> >\n>> > On these repositories, the correct thing would be to call\n>> > git-svnimport -T \"\",\n>> \n>> I would not call that the best solution: it makes the bad decision\n>> from the past impact useful work in the future.  I very much like git\n>> having a good toplevel directory structure.\n>\n> Besides the example of a mutating trunk directory, I have repositories\n> where there is only trunk (in \"/\" directory) and it never changes. Without\n> this patch, I can't even import that kind of repositories.\n\n[...]\n\n> The patch is for git-svnimport, not git-svn\n\nOops.  In that case, I have no qualified opinion.\n\n-- \nDavid Kastrup\n"}]}