{"thread":{"id":"31401","subject":"Grafting Alternate History","startedAt":"2012-08-31T23:39:58Z","lastAt":"2012-09-04T22:56:32Z","messageCount":3,"participants":["dag@cray.com","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"198174","messageId":"nng7gse7hrl.fsf@transit.us.cray.com","threadId":"31401","inReplyTo":null,"subject":"Grafting Alternate History","fromName":"","fromEmail":"dag@cray.com","sentAt":"2012-08-31T23:39:58Z","receivedAt":"2012-08-31T23:39:58Z","isPatch":false,"sender":{"key":"dag@cray.com","avatar":null},"body":"I have an unfortunate situation where I have two subversion repositories\nfor the same project, one a public version and one a private version.\nBecause they are mirrors of svn repositories, they have very different\nhistories as far as git is concerned.  This is not all that uncommon but\nof course I would like to manage things in git.\n\ngit-svn is great for interacting with one svn repository.  The public\nsvn repository has a fully-supported git mirror.  The private repository\nalso has a fully-supported git mirror.  But I need to check in changes\nto the private repository via git-svn.  I eventually need to check in\nchanges to the public repository as well but that is orders of magnitude\nless frequent.  A manual diff+patch+git-svn is acceptable for now.\n\nI am wondering if it's possible to graft the history of one of the git\nmirrors onto an empty branch of the other and share changes between\nthem.  I need to take updates from the public repository and apply them\nto the private repository.  This is a frequent operation.  I have been\nessentially using manual diff+patch but that is highly error-prone and\nannoying.\n\nFor example, let's say we take a local copy of the private repository.\nI would like to somehow create an empty branch in that local copy and\nthen populate it with the history of the public repository.  I would\nlike to be able to specify a git diff-like command on the public graft\nbranch to get some changes over a range of commits and apply those\nchanges to one of the private branches (say master).  If I could use a\ngit-merge-like or git-rebase-like command, so much the better.  I would\nlike to do the same in reverse but as I said that is a much less common\noperation.\n\nHas anyone done anything like this before?  Is it even theoretically\npossible to manage disjoint histories like this?\n\nThanks for your help!\n\n                            -Dave\n"},{"id":"198177","messageId":"m2harick7z.fsf@igel.home","threadId":"31401","inReplyTo":"nng7gse7hrl.fsf@transit.us.cray.com","subject":"Re: Grafting Alternate History","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2012-09-01T06:48:00Z","receivedAt":"2012-09-01T06:48:00Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"<dag@cray.com> writes:\n\n> For example, let's say we take a local copy of the private repository.\n> I would like to somehow create an empty branch in that local copy and\n> then populate it with the history of the public repository.  I would\n> like to be able to specify a git diff-like command on the public graft\n> branch to get some changes over a range of commits and apply those\n> changes to one of the private branches (say master).\n\nYou can set up (the git mirror of) the public repository as a remote in\nthe private repository and git cherry-pick the commits you want to copy\nover.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"198350","messageId":"nngmx155rdr.fsf@transit.us.cray.com","threadId":"31401","inReplyTo":"m2harick7z.fsf@igel.home","subject":"Re: Grafting Alternate History","fromName":"","fromEmail":"dag@cray.com","sentAt":"2012-09-04T22:56:32Z","receivedAt":"2012-09-04T22:56:32Z","isPatch":false,"sender":{"key":"dag@cray.com","avatar":null},"body":"Andreas Schwab <schwab@linux-m68k.org> writes:\n\n> You can set up (the git mirror of) the public repository as a remote in\n> the private repository and git cherry-pick the commits you want to copy\n> over.\n\nNow why didn't I think of that!?  :)\n\nThanks for helping an old bumbler along.  :)\n\n                         -Dave\n"}]}