{"thread":{"id":"23682","subject":"patches between different repositories","startedAt":"2010-05-03T17:47:30Z","lastAt":"2010-05-03T18:04:13Z","messageCount":2,"participants":["Matthias Lehmann","Dmitrijs Ledkovs"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"140837","messageId":"hrn27j$e3b$1@dough.gmane.org","threadId":"23682","inReplyTo":null,"subject":"patches between different repositories","fromName":"Matthias Lehmann","fromEmail":"mat@matlehmann.de","sentAt":"2010-05-03T17:47:30Z","receivedAt":"2010-05-03T17:47:30Z","isPatch":false,"sender":{"key":"mat@matlehmann.de","avatar":"https://gravatar.com/avatar/f7ed5f27a8e564c7f5fbadbdbc60b88e8a61697b978fabeca5006664285fe3f9?d=mp&s=160"},"body":"Hi all,\n\nI have to apply patches from one repository to another repository, which \nhave a different layout (I am working on splitting one big repository into \nseveral smaller ones, while development still continues on the big \nrepository).\n\nSo I did\n\nbig-repo$ git format-patche -o /tmp/foo @{some-date} -- subdir\nsmall-repo$ git apply -p2 --directory=some/path --check /tmp/foo/*\n\nand get\n\nfatal: git diff header lacks filename information when removing 2 leading \npathname components (line 37)\n\nthe patch looks like this:\n\n35| diff --git a/xyz/bar.jpg b/xyz/bar.jpg\n36| new file mode 100644\n37| index 0000000000000000000000000000000000000000.. \n3dcce2e1f68586ed2089d86b1bf4e7e41c818d97\n38| GIT binary patch\n39| literal 8791\n\nIt seems, like the -p options to git-apply can't handle new files.\n\nAm I doing something wrong here? Or is there another way to merge changes \nwithin different repositories with differnt layouts?\n\nAny help would be greatly appreciated.\n\nBest regards,\n\nMatthias\n"},{"id":"140839","messageId":"q2x86ecb3c71005031104xff08ab8am9a14bb49ebcd154f@mail.gmail.com","threadId":"23682","inReplyTo":"hrn27j$e3b$1@dough.gmane.org","subject":"Re: patches between different repositories","fromName":"Dmitrijs Ledkovs","fromEmail":"dmitrij.ledkov@ubuntu.com","sentAt":"2010-05-03T18:04:13Z","receivedAt":"2010-05-03T18:04:13Z","isPatch":false,"sender":{"key":"dmitrij.ledkov@ubuntu.com","avatar":"https://gravatar.com/avatar/79b618c6eb391ddb486c2ee0d3b429014e0e9ba579fd55f2e035f482fc8c24f4?d=mp&s=160"},"body":"On 3 May 2010 18:47, Matthias Lehmann <mat@matlehmann.de> wrote:\n> Am I doing something wrong here? Or is there another way to merge changes\n> within different repositories with differnt layouts?\n>\n> Any help would be greatly appreciated.\n\nTry sub-tree merge after the initial setup you will get another\nrepository as a subdirectory after that you can commit moving files\naround to match different layout. After that you can just pull & merge\nand everything will just work =)\n\nRead $ git help merge\n"}]}