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

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 24 12:03:51 PDT 2018


bogner added inline comments.


================
Comment at: llvm/docs/Proposals/GitHubMove.rst:866-868
+The simplest case is if you have a branch with linear history (i.e. no merges
+between the branch and upstream) and you're migrating from one monorepo to
+another.  We'll first explain how to handle this, then expand it to more
----------------
I guess the use case here is for local/in-progress branches, rather than any sort of real downstream consumer. Maybe we should point that out directly rather than having to infer it from the structure of the repos? I guess this one could be called "Local branches from one of the prototype monorepos".

Also it's a bit odd that this is first, before the "multirepo to monorepo" local branches case below ("Local branches from the official LLVM git mirrors"). I expect most developers have that case, since the monorepo prototypes are pretty new and aren't documented as the official way to do things.


================
Comment at: llvm/docs/Proposals/GitHubMove.rst:872
+  # Check that my-branch has linear history, i.e. never merges with
+  # `origin/master`.  A hacky way to do this is to find all merge commits in
+  # my-branch that are not in origin/master.
----------------
It's not clear what origin/master is meant to be here, since you don't say what origin is at all. Having the sections based on use cases rather than structure of the repos as I suggest above would probably help.


================
Comment at: llvm/docs/Proposals/GitHubMove.rst:933-935
+  $ git log -n1 --pretty="%aD %at" $(git merge-base origin/master my-branch)
+  $ git log -n1 --since <date from old-base-commit> \
+      --author <author from old-base-commit>
----------------
I guess the second command here should point at monorepo/master so it doesn't find the exact same commit as `git merge-base` did. In any case, this is an extremely tedious way to deal with this, especially when you have multiple branches.


================
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.
----------------
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.


https://reviews.llvm.org/D53414





More information about the llvm-commits mailing list