{"thread":{"id":"14161","subject":"how do I merge completely unrelated repositories ?","startedAt":"2008-06-26T09:39:37Z","lastAt":"2008-06-26T18:42:08Z","messageCount":9,"participants":["Christian MICHON","Miklos Vajna","Jakub Narebski","Johannes Schindelin","Oliver Kullmann","Asheesh Laroia","Kelly F. Hickel"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"81261","messageId":"46d6db660806260239xc57ffaag6469967ae2257cb1@mail.gmail.com","threadId":"14161","inReplyTo":null,"subject":"how do I merge completely unrelated repositories ?","fromName":"Christian MICHON","fromEmail":"christian.michon@gmail.com","sentAt":"2008-06-26T09:39:37Z","receivedAt":"2008-06-26T09:39:37Z","isPatch":false,"sender":{"key":"christian.michon@gmail.com","avatar":"https://gravatar.com/avatar/8a7c327b21187fbcab5c27640a49450eec72e0355dc292501197f27a5a744ec4?d=mp&s=160"},"body":"Hi,\n\nI'd like to create a new empty repository and merge into it 2\ncompletely unrelated remote repositories.\n\nHow would you do it, since merge will not merge if it cannot find a\ncommon ancestor ?\n\n-- \nChristian\n--\nhttp://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !\n"},{"id":"81262","messageId":"20080626094522.GA29404@genesis.frugalware.org","threadId":"14161","inReplyTo":"46d6db660806260239xc57ffaag6469967ae2257cb1@mail.gmail.com","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-26T09:45:22Z","receivedAt":"2008-06-26T09:45:22Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:\n> How would you do it, since merge will not merge if it cannot find a\n> common ancestor ?\n\nDid you try so?\n\nIf there are no conflicting paths then a simple\n\ngit pull /path/to/other/repo.git master\n\nor similar should work.\n"},{"id":"81266","messageId":"46d6db660806260351w6082b5f9q6db3ef62552fafc4@mail.gmail.com","threadId":"14161","inReplyTo":"20080626094522.GA29404@genesis.frugalware.org","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Christian MICHON","fromEmail":"christian.michon@gmail.com","sentAt":"2008-06-26T10:51:58Z","receivedAt":"2008-06-26T10:51:58Z","isPatch":false,"sender":{"key":"christian.michon@gmail.com","avatar":"https://gravatar.com/avatar/8a7c327b21187fbcab5c27640a49450eec72e0355dc292501197f27a5a744ec4?d=mp&s=160"},"body":"On Thu, Jun 26, 2008 at 11:45 AM, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:\n>> How would you do it, since merge will not merge if it cannot find a\n>> common ancestor ?\n>\n> Did you try so?\n\nyes I did. it was failing.\n\n>\n> If there are no conflicting paths then a simple\n>\n> git pull /path/to/other/repo.git master\n\npull = fetch + merge\n\nmaybe I was not fetching the objects properly.\n\n>\n> or similar should work.\n>\n\nyour hint works fine. thanks!\n\nI was starting considering rebasing the 2 repos on a common empty\ncommit (that would have been desperate)...\n\n-- \nChristian\n--\nhttp://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !\n"},{"id":"81268","messageId":"g3vt3r$lm3$1@ger.gmane.org","threadId":"14161","inReplyTo":"46d6db660806260239xc57ffaag6469967ae2257cb1@mail.gmail.com","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-26T11:04:27Z","receivedAt":"2008-06-26T11:04:27Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Christian MICHON wrote:\n\n> I'd like to create a new empty repository and merge into it 2\n> completely unrelated remote repositories.\n> \n> How would you do it, since merge will not merge if it cannot find a\n> common ancestor ?\n\nThe problem probably is _empty_ repository (what do you want to merge),\nnot lack of common ancestors.  git.git repository has joined unrelated\nprojects (git-mail-tools, gitweb, gitk, git-gui) and it has several\nroots, and even a few separate branches.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"81272","messageId":"alpine.DEB.1.00.0806261224020.9925@racer","threadId":"14161","inReplyTo":"20080626094522.GA29404@genesis.frugalware.org","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-26T11:25:54Z","receivedAt":"2008-06-26T11:25:54Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 26 Jun 2008, Miklos Vajna wrote:\n\n> On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:\n> > How would you do it, since merge will not merge if it cannot find a\n> > common ancestor ?\n> \n> Did you try so?\n> \n> If there are no conflicting paths then a simple\n> \n> git pull /path/to/other/repo.git master\n> \n> or similar should work.\n\nFWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project \nmerge of Paul Mackerras' gitk visualizer).  This also was often referred \nto as the \"coolest merge ever\".\n\nCiao,\nDscho\n"},{"id":"81283","messageId":"20080626121923.GE29404@genesis.frugalware.org","threadId":"14161","inReplyTo":"alpine.DEB.1.00.0806261224020.9925@racer","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-26T12:19:23Z","receivedAt":"2008-06-26T12:19:23Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Thu, Jun 26, 2008 at 12:25:54PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> FWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project \n> merge of Paul Mackerras' gitk visualizer).  This also was often referred \n> to as the \"coolest merge ever\".\n\nIf we are at it, that's not unique, there are other root commits as\nwell: 2744b23 - git-tools, 161332a - gitweb, cb07fc2 - git-gui, 16d6b8a\n- p4-fast-export. ;-)\n"},{"id":"81305","messageId":"20080626161941.GX20723@cs-wsok.swansea.ac.uk","threadId":"14161","inReplyTo":"alpine.DEB.1.00.0806261224020.9925@racer","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2008-06-26T16:19:41Z","receivedAt":"2008-06-26T16:19:41Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Hi,\n\nsince a similar question burdens my soul for quite some\ntime, I would like to take the opportunity to extend\nthe question a bit:\n\nI have around 10 CVS repositories, each with around 5 modules.\nThis has developed over time, and now I want to combine them\nall into a single Git repository, with a new directory\nstructure introduced.\n\nOne possibility would be to convert these 50 CVS modules \ninto git repositories, then for each of these git repositories\nintroduce the new tree structure (that is, what is relevant\nfor this part), move all files to their new location (via\n\"git mv\"), and finally pull everything in into the common\nrepository.\n\nThis is all fine, except of the inability to follow the history\nnicely (for example, via gitk I will only see the history\nfrom the point on where in those temporary git-repositories\nthe files have been moved to their new place).\n\nTo avoid this break in the history, it would be great if\ncvsimport could already move the files to the right place\nin the directory hierarchy, that is, if an additional\nparameter P could be given, the initial path, and files\nwill be imported as P/file. Then I could import everything right away into\nthe final git repository, without problems with clashes.\nI can't find something like that in the documentation.\n\nIs there perhaps some other possibility?\nIt seems easiest to me to do this little bit of surgery\nat the time of the import, before git gets into his\ntroubles with hash-values.\n\nthanks!\n\nOliver\n\n\nOn Thu, Jun 26, 2008 at 12:25:54PM +0100, Johannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 26 Jun 2008, Miklos Vajna wrote:\n> \n> > On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:\n> > > How would you do it, since merge will not merge if it cannot find a\n> > > common ancestor ?\n> > \n> > Did you try so?\n> > \n> > If there are no conflicting paths then a simple\n> > \n> > git pull /path/to/other/repo.git master\n> > \n> > or similar should work.\n> \n> FWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project \n> merge of Paul Mackerras' gitk visualizer).  This also was often referred \n> to as the \"coolest merge ever\".\n> \n"},{"id":"81306","messageId":"alpine.DEB.1.10.0806261120370.5253@sf.creativecommons.org","threadId":"14161","inReplyTo":"20080626161941.GX20723@cs-wsok.swansea.ac.uk","subject":"Re: how do I merge completely unrelated repositories ?","fromName":"Asheesh Laroia","fromEmail":"asheesh@asheesh.org","sentAt":"2008-06-26T18:26:40Z","receivedAt":"2008-06-26T18:26:40Z","isPatch":false,"sender":{"key":"asheesh@asheesh.org","avatar":"https://avatars.githubusercontent.com/u/25457?v=4"},"body":"On Thu, 26 Jun 2008, Oliver Kullmann wrote:\n\n> I have around 10 CVS repositories, each with around 5 modules. This has \n> developed over time, and now I want to combine them all into a single \n> Git repository, with a new directory structure introduced.\n\nI had a similar desire with git-svn; instead, what I do is a \ngit-filter-branch that renames all the files in the repository.\n\nman git-filter-branch gives you one way to do that; I basically \nre-invented that due to not scrolling all the way to the bottom, and run \nit every night on the git-svn repo since I want my everything-renamed repo \nto be kept as an up-to-date mirror of the svn repo.\n\nThat's my idea for you.\n\n-- Asheesh.\n\n-- \nFast, cheap, good: pick two.\n"},{"id":"81310","messageId":"63BEA5E623E09F4D92233FB12A9F794302389CAA@emailmn.mqsoftware.com","threadId":"14161","inReplyTo":"20080626161941.GX20723@cs-wsok.swansea.ac.uk","subject":"RE: how do I merge completely unrelated repositories ?","fromName":"Kelly F. Hickel","fromEmail":"kfh@mqsoftware.com","sentAt":"2008-06-26T18:42:08Z","receivedAt":"2008-06-26T18:42:08Z","isPatch":false,"sender":{"key":"kfh@mqsoftware.com","avatar":null},"body":"\n> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On\n> Behalf Of Oliver Kullmann\n> Sent: Thursday, June 26, 2008 11:20 AM\n> To: git@vger.kernel.org\n> Subject: Re: how do I merge completely unrelated repositories ?\n> \n> Hi,\n> \n> since a similar question burdens my soul for quite some\n> time, I would like to take the opportunity to extend\n> the question a bit:\n> \n> I have around 10 CVS repositories, each with around 5 modules.\n> This has developed over time, and now I want to combine them\n> all into a single Git repository, with a new directory\n> structure introduced.\n> \n> One possibility would be to convert these 50 CVS modules\n> into git repositories, then for each of these git repositories\n> introduce the new tree structure (that is, what is relevant\n> for this part), move all files to their new location (via\n> \"git mv\"), and finally pull everything in into the common\n> repository.\n> \n> This is all fine, except of the inability to follow the history\n> nicely (for example, via gitk I will only see the history\n> from the point on where in those temporary git-repositories\n> the files have been moved to their new place).\n> \n> To avoid this break in the history, it would be great if\n> cvsimport could already move the files to the right place\n> in the directory hierarchy, that is, if an additional\n> parameter P could be given, the initial path, and files\n> will be imported as P/file. Then I could import everything right away\n> into\n> the final git repository, without problems with clashes.\n> I can't find something like that in the documentation.\n> \n> Is there perhaps some other possibility?\n> It seems easiest to me to do this little bit of surgery\n> at the time of the import, before git gets into his\n> troubles with hash-values.\n> \n> thanks!\n> \n> Oliver\n> \n> \nOliver,\n  I wrote a little (314 line) perl script to blend multiple cvsps output\nstreams together before handing them to git-cvsimport, it seems to work\nfine.  It should (but I haven't tested it) even still allow the\nincremental approach.\n\nNot sure if I should just attach it here (it's not that big, but still),\nbut if you need/want a copy of \"cvsps_blender.pl\", just send me an email\nand I'll send it out....\n\n-Kelly\n"}]}