{"thread":{"id":"32255","subject":"Stitching histories of several repositories","startedAt":"2012-12-01T09:11:29Z","lastAt":"2012-12-06T00:00:15Z","messageCount":2,"participants":["Ramkumar Ramachandra","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"204369","messageId":"CALkWK0kCQQioCeuwWAAWfKodvOR+w+hB=11MYs5mGviN6Zy5qA@mail.gmail.com","threadId":"32255","inReplyTo":null,"subject":"Stitching histories of several repositories","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-12-01T09:11:29Z","receivedAt":"2012-12-01T09:11:29Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nI've written a tool to stitch the first-parent histories of several\ngit repositories.  To illustrate, consider that we have a toplevel git\nrepository inside which the other repositories reside.\n\n  /.git\n  /a/.git\n  /b/.git\n\nThe tool pulls in the objects from /a/.git and /b/.git into /.git by\nusing alternates.  Then, it gets the list of commits by rev-list'ing\nand emits a fast-import stream rewriting the paths of the files in a/\nfrom / to a/ and the paths of files in b/ form / to b/ (using M\n040000), taking care to have one unified first-parent line.  It turns\nout that this is quite non-trivial when the individual git\nrepositories contain lots of merges.  To illustrate, this is an\nexample of how histories from two repositories with one merge commit\neach would be stitched:\n\n  *   c1f81f1 (refs/figlets/first/origin/master)\n  |\\\n  | * 6eaf22f (refs/figlets/first-2/origin/master)\n  * 15cd841\n\n  *   1f2f408 (refs/figlets/second/origin/master)\n  |\\\n  | * 4bd7fe3 (refs/figlets/second-2/origin/master)\n  * bfa9f3c\n\n  *   5e1d337 (refs/replay/stitch2, fig/stitch2)\n  |\\\n  | * 23437d5 (refs/replay/1f2f40-2)\n  |/\n  *   4f2d70b\n  |\\\n  | * e017fa5 (refs/replay/c1f81f-2)\n  * c0251c7\n  * 4036fea\n\nI'd like to know whether the tool would be useful to a wider audience,\nbefore I polish it and consider submitting it for inclusion in\ncontrib/.  I think the tool is especially useful for running bisect\nand tracking bugs that occur in large projects that consist of many\ngit repositories.  Will a unified log showing commits in different\nsubmodules be useful?\n\nRam\n"},{"id":"204548","messageId":"1887785531.19321537.1354752015863.JavaMail.root@dewire.com","threadId":"32255","inReplyTo":"CALkWK0kCQQioCeuwWAAWfKodvOR+w+hB=11MYs5mGviN6Zy5qA@mail.gmail.com","subject":"Re: Stitching histories of several repositories","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2012-12-06T00:00:15Z","receivedAt":"2012-12-06T00:00:15Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"\n\n----- Ursprungligt meddelande -----\n> Hi,\n> \n> I've written a tool to stitch the first-parent histories of several\n> git repositories.  To illustrate, consider that we have a toplevel\n> git\n> repository inside which the other repositories reside.\n> \n[...]\n> \n> I'd like to know whether the tool would be useful to a wider\n> audience,\n> before I polish it and consider submitting it for inclusion in\n> contrib/.  I think the tool is especially useful for running bisect\n> and tracking bugs that occur in large projects that consist of many\n> git repositories.  Will a unified log showing commits in different\n> submodules be useful?\n\nI think it is useful. I did something like that creating a super-repo\nfor performing a bisect over EGit and JGit over a period over a year.\nI don't think I restricted myself to the first parent, which was probably\na mistake.\n\nThe solution isn't perfect, but provided that is well-known you can\nlive with that. A problem I found was that many stiches versions weren't\neven compilable so one might want to have the option of matching commits\nusing a window of some sort to identify compilable combinations and have\nthe ability to use only those for bisect. I'm not sure it's practical though.\n\n-- robin\n"}]}