Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three-way merging #12

Open
olimsaidov opened this issue Feb 18, 2020 · 1 comment
Open

Three-way merging #12

olimsaidov opened this issue Feb 18, 2020 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@olimsaidov
Copy link

I want to implement a function (diff3 a o b) where o is common ancestor of a and b. The straightforward solution is combining editscripts of two diffs: (patch o (combine (diff o a) (diff o b))). But I stuck with detecting conflicts when concurrent updates happens at same place in a and b.

Is there any known solutions or algorithms of iterating over those editscripts and finding conflicting nodes?

@huahaiy
Copy link
Contributor

huahaiy commented Feb 20, 2020

The known algorithm for three-way merge works for linear text. E.g. https://www.cis.upenn.edu/~bcpierce/papers/diff3-short.pdf This may or may not be easy to adapt for tree merging. I have not investigated this in details.

Depending on what you want to do, you may not need three-way merge. For example, for synchronizing collaborative edits, Differential Synchronization should work on all kinds of data structure in principle. https://neil.fraser.name/writing/sync/

@huahaiy huahaiy added the question Further information is requested label Feb 13, 2021
@huahaiy huahaiy added the enhancement New feature or request label Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants