On Sat, Aug 17, 2019 at 11:41:24AM -0700, Elijah Newren wrote:
> In commit 7ca56aa07619 ("merge-recursive: add a label for ancestor",
> 2010-03-20), a label was added for the '||||||' line to make it have
> the more informative heading '|||||| merged common ancestors', with
> the statement:
>
> It would be nicer to use a more informative label. Perhaps someone
> will provide one some day.
>
> This chosen label was perfectly reasonable when recursiveness kicks in,
> i.e. when there are multiple merge bases. (I can't think of a better
> label in such cases.) But it is actually somewhat misleading when there
> is a unique merge base or no merge base. Change this based on the
> number of merge bases:
> >=2: "merged common ancestors"
> 1: <abbreviated commit hash>
> 0: "<empty tree>"
I got a funny result from this today while rebasing some patches in
git.git, where the base is reported as "00000000". I didn't make a
minimal case, but you can easily reproduce it with:
cd /your/git/clone
git fetch https://github.com/peff/git odd-diff3-base
git checkout -b odd-diff3-base FETCH_HEAD
git -c merge.conflictstyle=diff3 rebase --onto origin/master HEAD~2
Maybe this has to do with "git apply --build-fake-ancestor" being used
under the hood?
-Peff