The “takeaway” in the above screenshot, is that Git merge arbitrarily places X. But, I also see Pijul’s merge as arbitrary. Am I missing something?
How does Pijul infer that lines A, B get prepended to the file. Technically it only sees the file A\nB\nG\nA\nB. It doesn’t know how that file was arrived at. It would need to know the operations performed on the file to know how to complete this unambiguously. For example, suppose that Alice does this sequence instead which produces the same state. From G\nA\nB: Shift A to the top of the file producing A\nG\nB, Inject B on line 2 producing A\nB\nG\nB, then insert an A between last two lines producing A\nB\nG\nA\nB. Is there a reason this sequence is not inferred? It’s just more edits?
You have a different “takeaway” than I do from that graphic. I tried this in Git, and when I got to the merge part, I looked at the help (since I didn’t know the command), and it says that it will play the commits from the parameter onto the current branch. So the result is dependent on the context of the branch. I got the same result as the graphic when I was on the Alice branch and merged the Bob branch (using no special options, but there are a lot of them to choose). I’m not sure if it would be the same if I was on the Bob branch and merged the Alice branch. That doesn’t sound arbitrary to me.
I don’t know that the Pijul choice is any more correct, but it is likely to also be sensitive to the order of the patches you have. Many times, I pull the pijul repo and it gives order conflicts on Cargo.lock (and that’s with me making no local changes).
Neither tool knows the editing details of the file, but they do store different information about the “commit” made. They apparently have different algorithms for merge.
I’m just wondering if there is a clear reason why pijul’s behavior (in the graphic) is deemed more correct. It appears to me you have to guess what operations occurred between two file versions, and this graphic shows two different guesses.
There’s nothing new in what you are saying… of course the docs have a bias toward Pijul.
There is no guessing going on. It is two different ways to merge, and Git has a lot of options to merge in different ways.
At least the Git help tells you why you get what you get.