-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related improvements in future Git (based on merge-ort) #105
Comments
I believed I looked at EDIT: see below, I was mistaken. |
I believe if you want to merge a bunch of commits, then having one "merge base" (the common ancestor) is enough, no need for more. |
What I was talking about is what Elijah is referring to in this comment in this article, regarding a "funny merge base":
So it's not that you don't need multiple bases, but the merge-base needs to be the parent commit of the commit to be rebased. This often isn't an ancestor of the destination commit at all! That is, in this diagram:
If you want to rebase But it looks like I was mistaken anyways. For some reason, I thought that you needed two different base commits to compare against: one for the source commit, and one for the destination commit. This isn't the case, as you only need one base commit. It just might not be a common ancestor of the two commits. It seems that you can specify whatever base tree you want for the first argument to |
oh wow, thanks for the clarification! |
I've been reading Elijah Newren's blog posts on optimizing git's merge implementation. To enable the optimizations, they added the new "ort" merge backend.
Crucially, it can merge without touching the working tree or index. These two commit messages are nice reads:
This sounds like we're one step closer to getting some of git-revise's features in core git.
git-rebase
(andgit cherry-pick
) should move towards only touching the worktree when needed, as this comment suggests.If that becomes reality one day, the main difference is conflict resolution (with git-revise using a temporary file (?).
Another difference is that git-revise never reparents a branch (i.e. it does not add new commits from upstream).
Maybe it makes sense to split
git rebase
intogit rebase
(for reparenting) andgit revise
(for history modification), likereset/checkout
split offrestore/switch
. Ofc that's another discussion on the Git project.I just discoveredgit merge-tree
which has apparently always been able to merge without touching index/worktree; I wonder if this is powerful enough to replace our use ofgit merge-file
. (I'm not sure what's the difference to the ort merge, probably this one doesn't detect renames etc.),git merge-tree
can't change commit messages, so it's not usable for git-revise.The text was updated successfully, but these errors were encountered: