{"thread":{"id":"29790","subject":"How to use subtrees when importing SVN repository with \"vendor\" branches?","startedAt":"2012-03-01T00:35:36Z","lastAt":"2012-03-01T00:35:36Z","messageCount":1,"participants":["Carsten Fuchs"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"185755","messageId":"4F4EC458.8090808@cafu.de","threadId":"29790","inReplyTo":null,"subject":"How to use subtrees when importing SVN repository with \"vendor\" branches?","fromName":"Carsten Fuchs","fromEmail":"carsten.fuchs@cafu.de","sentAt":"2012-03-01T00:35:36Z","receivedAt":"2012-03-01T00:35:36Z","isPatch":false,"sender":{"key":"carsten.fuchs@cafu.de","avatar":"https://gravatar.com/avatar/bd0d6585c2cec9529584fc310bbcdee3ffd1f06f3fb88644fdb87fd880fc75a6?d=mp&s=160"},"body":"Hi all,\n\nusing git-svn, I've been converting our old SVN repositories to git with great success, \nbut I don't know how to deal with our biggest and most important one.\nThe SVN repository structure is like this:\n\n\tbranches/\n\ttags/\n\ttrunk/\n\t\tExtLibs/\n\t\t\tlibpng/\n\t\t\tzlib/\n\t\t\t...\n\t\tsome_dir_a/\n\t\tsome_dir_b/\n\tvendor/\n\t\tlibpng/\n\t\tzlib/\n\t\t...\n\nThe key problem is that we used to use the SVN \"vendor branches\" strategy: When a new \nversion of libpng or zlib or ... is released, we update the vendor/ directory \nappropriately (essentially: delete the old files of the library, extract the tarball of \nthe new release, commit).\nThen we \"SVN merged\" the vendor/ directory into trunk/ExtLibs/.\nThis way, we were able to preserve our occasional customizations to the libraries in \nExtLibs/ while updating to new vendor releases.\n\nUsing something like\n\tgit svn init \"svn://.../project_root\" --trunk \"trunk\" git_test_project\nit would be easy to fetch the projects trunk (never mind the branches and tags, we never \nused them much and are happy to ignore them). This properly converts the whole trunk to \ngit, including subdirectory trunk/ExtLibs/, but with no notion of vendor/.\n\nIn contrast, using something like\n\tgit svn init \"svn://.../project_root\" --trunk \"trunk/ExtLibs\" git_test_ExtLibs\n\tgit config --add svn-remote.svn.fetch \"vendor:refs/remotes/vendor\"\n\tgit svn fetch\nyields a new clean \"ExtLibs-only\" git repository with the two branches trunk and vendor, \nand proper merge history (helped with grafting, where necessary), but is so far entirely \nunrelated to the main project repository.\n\nWell... it seems like subtrees and subtree merging is a good way to proceed, but even \nthough I've read everything I could find about the subject, I don't quite see how I can \nemploy it in the case above, where ExtLibs/ isn't newly created, but history already exists.\n\nCould you please give me an idea how I properly merge ExtLibs as a subdirectory into the \nmain repository, including the history? I can add the ExtLibs repository (created as \nshown above) as a remote reference to the main repository, yielding a multi-root \nrepository, but what then? Or should I rather convert only vendor/ and use that as a \nremote for merging? (Can grafting put to work in the subtrees context?)\n\nI'd be very grateful for your help!\n\nBest regards,\nCarsten\n\n\n\n-- \n    Cafu - the open-source Game and Graphics Engine\nfor multiplayer, cross-platform, real-time 3D Action\n           Learn more at http://www.cafu.de\n"}]}