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

Conflicts where left == right #225

Open
slarse opened this issue Jul 16, 2021 · 0 comments
Open

Conflicts where left == right #225

slarse opened this issue Jul 16, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@slarse
Copy link
Collaborator

slarse commented Jul 16, 2021

Due to the conservative XY-matcher used for the left-to-right matching, identical additions can sometimes cause very strange conflicts. For example, given these three revisions of a method call:

left base right
add(-a, b, c) add(a, b) sum(-a, b, c)

We get the following merge conflict:

sum(-a, b, 
<<<<<<< LEFT
c
=======
c
>>>>>>> RIGHT
        );

The reason for this is that the c node is, in fact, not matched by the XY-matcher. Regardless of how we tune the matcher, there's always a slight possibility of this happening. A simple solution would be to add a conflict handler that simply checks if the left and right sides of a conflict are equal, and if they are just pick either side as the resolution.

@slarse slarse added the bug Something isn't working label Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant