mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-15 16:53:25 +00:00
9d4a97381f
Let's say we're updating one parent of a merge: ``` E E' /|\ /|\ B C D -> B C D' \|/ \|/ A A ``` When rebasing `E` to create `E'` there, we do that by merging the changes compared to the auto-merged parents. The auto-merged parents before is `B+(C-A)+(D-A)`, and after it's `B+(C-A)+(D'-A)`. Then we rebase the diff, which gives us `E' = B+(C-A)+(D'-A) + (E - (B+(C-A)+(D-A))) = D' + (E - D')`. However, we currently don't do quite that simplification because we first resolve conflicts when possible in the two auto-merged parent trees (before and after). That rarely makes a difference to the result, but it's wasteful to do it. It does make a difference in some cases where our merge algorithm is lossy, which currently is only the "A+(A-B)=A" case. I added a test case showing where it does make a difference. It's a non-obvious cases but I think the new behavior is more correct (the old behavior was a conflict). |
||
---|---|---|
.. | ||
benches | ||
gen-protos | ||
proc-macros | ||
src | ||
tests | ||
testutils | ||
Cargo.toml | ||
LICENSE |