jj/lib
Martin von Zweigbergk 9d4a97381f rewrite: don't resolve intermediate parent tree when rebasing
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).
2024-10-21 10:58:47 -07:00
..
benches
gen-protos
proc-macros
src rewrite: don't resolve intermediate parent tree when rebasing 2024-10-21 10:58:47 -07:00
tests rewrite: don't resolve intermediate parent tree when rebasing 2024-10-21 10:58:47 -07:00
testutils
Cargo.toml
LICENSE