{"thread":{"id":"47589","subject":"git svn clone of messy repository","startedAt":"2018-01-11T00:29:38Z","lastAt":"2018-01-11T09:05:34Z","messageCount":2,"participants":["Jason Greenbaum","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"336438","messageId":"CAKNOR-JbAjE9URdFw_ZrqVeZot=emHFWLgpjhQ7uqUsJpRzx2A@mail.gmail.com","threadId":"47589","inReplyTo":null,"subject":"git svn clone of messy repository","fromName":"Jason Greenbaum","fromEmail":"jgbaum@lji.org","sentAt":"2018-01-11T00:29:12Z","receivedAt":"2018-01-11T00:29:38Z","isPatch":false,"sender":{"key":"jgbaum@lji.org","avatar":null},"body":"Hi,\n\nI'm in the process of using git svn to migrate several repos over to\ngit and one repo, in particular, has a very challenging format.\nDuring the migration, I would also like to reorganize the repo.  It\nlooks something like this in svn:\n\nmyrepo\n  trunk\n    project_of_interest\n    other_project1\n    other_project2\n    …\n  branches\n    FF-1.0\n      project_of_interest\n      other_project1\n      other_project2\n      …\n   FF-1.1\n      project_of_interest\n      other_project1\n      other_project2\n      …\n\nThere is also a 'tags' directory at the toplevel, but that's not\nimportant to illustrate the issue I'm having.  What I would like to do\nis to migrate ONLY the folder called 'project_of_interest' and\npreserve it's trunk, branches, and tags.  I'm not sure this is\npossible directly with git svn clone, but here is what I've tried:\n\ngit svn clone \\\n--authors-file=$AUTHORS_FILE \\\n--prefix=\"\" \\\n--trunk=trunk/project_of_interest \\\n--branches=branches/FF-1.0/project_of_interest \\\n--branches=branches/FF-1.1/project_of_interest \\\nsvn://my-svn-server/myrepo \\\nproject_of_interest.git\n\nThe trunk seems to become the 'master' branch just fine, but my svn\nbranches are not pulled down.  I'm not sure I have the syntax right or\nif this is even possible without first reorganizing the svn repo in\nplace, updating the .git/config file, or by some other means.  Any\nhelp would be much appreciated.  I'm happy to provide more info as\nneeded.\n\nThanks,\n\nJason\n"},{"id":"336445","messageId":"20180111090452.GA29874@dcvr","threadId":"47589","inReplyTo":"CAKNOR-JbAjE9URdFw_ZrqVeZot=emHFWLgpjhQ7uqUsJpRzx2A@mail.gmail.com","subject":"Re: git svn clone of messy repository","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2018-01-11T09:04:52Z","receivedAt":"2018-01-11T09:05:34Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jason Greenbaum <jgbaum@lji.org> wrote:\n> --trunk=trunk/project_of_interest \\\n> --branches=branches/FF-1.0/project_of_interest \\\n> --branches=branches/FF-1.1/project_of_interest \\\n\n> The trunk seems to become the 'master' branch just fine, but my svn\n> branches are not pulled down.  I'm not sure I have the syntax right or\n> if this is even possible without first reorganizing the svn repo in\n> place, updating the .git/config file, or by some other means.\n\nBy default, the basename (\"project_of_interest\") is used and you\nget collisions.\n\nI think this section of the git-svn manpage should help:\n\n| When using multiple --branches or --tags, 'git svn' does not automatically\n| handle name collisions (for example, if two branches from different paths have\n| the same name, or if a branch and a tag have the same name).  In these cases,\n| use 'init' to set up your Git repository then, before your first 'fetch', edit\n| the $GIT_DIR/config file so that the branches and tags are associated\n| with different name spaces.  For example:\n| \n| \tbranches = stable/*:refs/remotes/svn/stable/*\n| \tbranches = debug/*:refs/remotes/svn/debug/*\n\n"}]}