I am trying to understand rebasing better (BTW, setMirror
seems not documented).
So if I have confirmed steps [A, B, C]
and unconfirmed step E
, then if I get D
to be before E
, rebasing does:
- Apply inverse of
E
. - Apply
D
. - Apply
E
mapped over[D]
.
I then get [A, B, C, D, E]
. I understand this.
But if I have a more complicated example, where I have [A, B, C]
confirmed, and unconfirmed [E, F]
. And I get [D, E']
, where E'
is the same as E
, only that it has already been rebased on top of D
. In my case I can get something like this because I am trying to get my clients to share some state directly between each other, before they get to confirm it on the server. Let’s assume I can detect that relation between E
and E'
. My question is if there is a better way to do a rebase in such case. The straightforward approach based on existing code would be to do:
- Apply inverse of
F
, - Apply inverse of
E
. - Apply
D
. - Ignore
E'
. - Apply
E
mapped over[D]
. - Apply
F
mapped over[inverse of E, D, E mapped over D]
.
But it would be slightly easier for me to implement this if I could start with [A, B, C, D, E']
and somehow rebase F
on top of that. I am not sure how to map F
in such case.