[PATCH] D53414: Add instructions for migrating branches from one git repository to another.

Justin Lebar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 18:23:02 PDT 2018


jlebar added inline comments.


================
Comment at: llvm/docs/Proposals/GitHubMove.rst:938-943
+Multirepo to Monorepo, With Merges
+----------------------------------
+
+If you have a branch on an old *multirepo* and have merges, you'll want to
+follow the steps above but pass `-s subtree` to do a subtree-merge, see
+https://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging.
----------------
greened wrote:
> bogner wrote:
> > I expect this is the common case for anyone with any significant out of tree changes. We probably need to pay a bit more attention to it.
> Agreed.  It is definitely the situation for us.  I suspect the vast majority of cases will be people using the existing project repositories, with their own long-lived branches that have periodic merges from master.  Essentially, downstream looks like a "downstream master" branches that periodically merge from the "upstream master" branches to sync up.
> 
> In our situation we have multiple such "downstream master" branches, one for each project repository we're using (llvm, compiler-rt, etc.).  It's not at all clear to me how we will transition those multiple branches to a single "downstream master" branch on the monorepo.
> 
> In the worst case we'll replay all of our downstream commits on top of the monorepo master, but I am hoping there is a better way.
I hear that you and others are in this position.

Do you want to rewrite history so it's like you always had a monorepo?  That's tantamount to "replaying all of our downstream commits on top of the monorepo master".  It's going to be painful, but it sounds like you have a rough idea of how to do it?  I'm not sure what a better way would be, in part because I'm not sure what you're trying to accomplish.

Anyway writing such a tool was not what I meant to volunteer for when I volunteered to write this patch.  Do you want me to abandon it?


https://reviews.llvm.org/D53414





More information about the llvm-commits mailing list