{"thread":{"id":"21505","subject":"question: connecting to multiple remote svn projects","startedAt":"2009-11-06T17:55:46Z","lastAt":"2009-11-09T18:43:46Z","messageCount":4,"participants":["Dave Rodgman","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"126995","messageId":"hd1nv2$79e$1@ger.gmane.org","threadId":"21505","inReplyTo":null,"subject":"question: connecting to multiple remote svn projects","fromName":"Dave Rodgman","fromEmail":"dav1dr@eml.cc","sentAt":"2009-11-06T17:55:46Z","receivedAt":"2009-11-06T17:55:46Z","isPatch":false,"sender":{"key":"dav1dr@eml.cc","avatar":null},"body":"Hi,\n\nGiven a layout in a single subversion repository like this:\n\nmodule1/branches/1.0/work\nmodule2/branches/1.0/work\n\nI would like achieve the following layout locally, in git:\n\nmodule1/work\nmodule2/work\n\nObviously I can create multiple git repositories in separate directories, \nbut I would like them to be in a single repository. I can also get the \nsame layout as subversion, but this breaks various bits of build \ninfrastructure. I've fiddled with --branches, etc on git svn init\nbut can't figure out how to achieve this. \n\nI don't care about tracking the subversion branches in git, or being able\nto switch between subversion branches.\n\nIs this possible? How can I do this?\n\nmany thanks\n\nDave\n"},{"id":"127001","messageId":"32541b130911061151q68ddcc58w209acf28c5eec2f@mail.gmail.com","threadId":"21505","inReplyTo":"hd1nv2$79e$1@ger.gmane.org","subject":"Re: question: connecting to multiple remote svn projects","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-11-06T19:51:28Z","receivedAt":"2009-11-06T19:51:28Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Fri, Nov 6, 2009 at 12:55 PM, Dave Rodgman <dav1dr@eml.cc> wrote:\n> Given a layout in a single subversion repository like this:\n>\n> module1/branches/1.0/work\n> module2/branches/1.0/work\n>\n> I would like achieve the following layout locally, in git:\n>\n> module1/work\n> module2/work\n>\n> Obviously I can create multiple git repositories in separate directories,\n> but I would like them to be in a single repository. I can also get the\n> same layout as subversion, but this breaks various bits of build\n> infrastructure.\n\nCan you just create the file structure you want using symlinks?  That\nwould be the easiest way.\n\n> I don't care about tracking the subversion branches in git, or being able\n> to switch between subversion branches.\n\nDon't care about tracking *any* subversion history, or just the\nhistory of branches other than the 1.0 branch you've listed above?  I\nassume the latter, because otherwise the problem is easy (just copy\nthe latest revision of the files into a git repo and commit).\n\nOther options that might work for you: create a \"superproject\" branch\nand import the two modules using git-submodule, or else import them\nusing git-subtree (http://github.com/apenwarr/git-subtree).  Or import\nthe svn history and then use git-filter-branch to move stuff around.\n\nGood luck.\n\nAvery\n"},{"id":"127134","messageId":"hd8smd$79e$2@ger.gmane.org","threadId":"21505","inReplyTo":"32541b130911061151q68ddcc58w209acf28c5eec2f@mail.gmail.com","subject":"Re: question: connecting to multiple remote svn projects","fromName":"Dave Rodgman","fromEmail":"dav1dr@eml.cc","sentAt":"2009-11-09T10:59:25Z","receivedAt":"2009-11-09T10:59:25Z","isPatch":false,"sender":{"key":"dav1dr@eml.cc","avatar":null},"body":">> Given a layout in a single subversion repository like this:\n>>\n>> module1/branches/1.0/work\n>> module2/branches/1.0/work\n>>\n>> I would like achieve the following layout locally, in git:\n>>\n>> module1/work\n>> module2/work\n>>\n>> Obviously I can create multiple git repositories in separate\n>> directories, but I would like them to be in a single repository. I can\n>> also get the same layout as subversion, but this breaks various bits of\n>> build infrastructure.\n> \n> Can you just create the file structure you want using symlinks?  That\n> would be the easiest way.\n\nIt would, and this is what I do on Linux. On Windows, obviously, this \ndoesn't work.\n\n>> I don't care about tracking the subversion branches in git, or being\n>> able to switch between subversion branches.\n> \n> Don't care about tracking *any* subversion history, or just the history\n> of branches other than the 1.0 branch you've listed above?  I assume the\n> latter, because otherwise the problem is easy (just copy the latest\n> revision of the files into a git repo and commit).\n\nIndeed. I want history, but only for a given branch. \n\n> Other options that might work for you: create a \"superproject\" branch\n> and import the two modules using git-submodule, or else import them\n> using git-subtree (http://github.com/apenwarr/git-subtree).  Or import\n> the svn history and then use git-filter-branch to move stuff around.\n\nAs far as I can understand, git-submodule pulls in a specific commit,\nas does git subtree? I've experimented a little but with not much success.\n\nI want \"git svn rebase\" (or some equivalent command, or series of \ncommands) to update the contents of module1/work to the latest commit \ninto this branch, and similarly \"git svn dcommit\" should also commit into \nmodule1, module2, etc. Basically, I want my working copy to have the same \nfunctionality as if moduleX/work was the actual layout in subversion. I'm\nusing git as a client for a svn repository, rather than doing a one-time\nimport. Is this possible?\n\nthanks for your help\n\nDave\n"},{"id":"127184","messageId":"32541b130911091043k78ac009dmb49ecdb0beaa597f@mail.gmail.com","threadId":"21505","inReplyTo":"hd8smd$79e$2@ger.gmane.org","subject":"Re: question: connecting to multiple remote svn projects","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2009-11-09T18:43:46Z","receivedAt":"2009-11-09T18:43:46Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Mon, Nov 9, 2009 at 5:59 AM, Dave Rodgman <dav1dr@eml.cc> wrote:\n> As far as I can understand, git-submodule pulls in a specific commit,\n> as does git subtree? I've experimented a little but with not much success.\n\nWell, they both pull in a specific commit *and* all the history\nleading up to it, although the two of them do it in slightly different\nways.\n\n> I want \"git svn rebase\" (or some equivalent command, or series of\n> commands) to update the contents of module1/work to the latest commit\n> into this branch, and similarly \"git svn dcommit\" should also commit into\n> module1, module2, etc. Basically, I want my working copy to have the same\n> functionality as if moduleX/work was the actual layout in subversion. I'm\n> using git as a client for a svn repository, rather than doing a one-time\n> import. Is this possible?\n\nYes.  Both tools will work for two-way svn import/export, although\nsubmodules will probably be a bit more convenient.\n\nEssentially, you create one branch (and one git-svn remote entry) for\neach svn subproject, and one branch for the combined project.  In the\ncombined project, your .gitmodules should use '.' as the submodule\nrepository path (since all your submodule objects are in the same\nlocal repo).\n\nThen you 'git svn fetch' to retrieve the latest from each svn project.\n\nThen, in each submodule, you can 'git pull .. git-svn-branchname' to\nget the latest stuff from git-svn for that branch.\n\nThen, in the combined project, you 'git commit' to lock in those commits.\n\nIt's a little screwy, but it works :)\n\nAvery\n"}]}