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

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 06:29:16 PDT 2018


fedor.sergeev added inline comments.


================
Comment at: llvm/docs/Proposals/GitHubMove.rst:934-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>
+  $ git merge <new-base-commit>
----------------
I'm afraid this wont work. --since sets a bottom limit for the commits shown with git-log, but git-log starts from the top (HEAD), so in most cases it will be equivalent to git log -n1 --author <xxx>, which is absolutely not whats needed here.

Perhaps doing both --since/--until can do the trick. And if we find the times of commits reliable enough then we can automate it:

merge_base=$(git merge-base origin/master my-branch)
merge_time=$(git log -n1 --pretty=%at $merge_base)
merge_author=$(git log -n1 --pretty="%an <%ae>" $merge_base)
git log -n1 --since="@$merge-time" --until="@$merge_time" --author="$merge_author"


https://reviews.llvm.org/D53414





More information about the llvm-commits mailing list