FR: `jj resolve` should support complex conflicts with more than 2 sides
I'm surprised that we don't seem to have a tracking bug for this already. The idea is to resolve complex conflicts by repeatedly asking the user to resolve 2 sides at a time, reducing the number of sides by one every time.
Yes, I just came here to open this issue. Especially with an automated resolver like https://mergiraf.org this could be very useful.
Assuming I'm using a noninteractive resolution tool, I'm wondering whether it is possible to specify the expectations to that tool. We should expect it respect an associativity law. Maybe it's possible to test the different orders in which we can resolve, and make sure that they all yield the same result, else error?
mergiraf at least does not really have the assumption that there is only one solution for a conflict. If called on different permutations of a multi sided conflict it could very well produce different results e.g. because of commutativity of certain syntax constructs which are operationally equivalent. (And I also don’t think jujutsu does. Prompted at different times a user could provide different manual resolutions of the conflict which might not even be equivalent but can still all be "correct" in a vague user defined sense.)
If an (automatic) tool decides that it can resolve a conflict we should trust it that it resolved the conflict correctly. If it resolved a chain of conflicts correctly we should also trust that. If the permutation results in different resolutions we should assume that all resolutions are correct. In short I don’t think that conflict resolutions are commutative or associative.
However, in theory: If an automatic resolution fails we could try if another permutation works, but that is very much a nice to have. imo.