Merged
Conversation
May re-generify at a later time once the architecture is more stable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #21
First step toward #20
Tests current implementation for #19
This is a big PR with a lot of changes that aim to support handling of structural conflicts. It works in a few steps.
deltaobject.https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/merge/TdmMerge.java#L59
https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/merge/spoon/SpoonPcs.java#L116-L121
https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/merge/spoon/SpoonPcs.java#L141-L168
https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/merge/spoon/SpoonPcs.java#L278-L306
https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/cli/SporkPrettyPrinter.java#L25-L67
An important detail
A super important detail is that the left/right match is done only top-down.
https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/merge/spoon/Spoon3dmMerge.java#L66
https://github.com/KTH/spork/blob/deddea7e40b9cf3702610c43c093c2ed1ad3bf94/src/main/java/se/kth/spork/merge/spoon/Spoon3dmMerge.java#L258-L262
This means that conflicts become less granular than they could be, but in my limited testing they've been made much more comprehensible this way, and it also eliminates the problem of nested conflicts, which I really don't know how to represent textually. Although high granularity may sound awesome on paper, it can get to a point where there's just so much visual noise from the conflict markers that a rougher separation is better. I think that I will have to do some further experimentation here, but initially I think it's a good idea.
A bit hacky?
Yes, this is a little bit hacky, but there's a large benefit of handling structural conflicts this way, namely that no special Spoon nodes need to be implemented. The alternative would really be to have some special "conflict" nodes, e.g. a
CtStatementConflict, which is a CtStatment in and of itself, but also has a left and right revision of statement lists. That may be a better way moving forward, but for now I think solution will be all right for prototyping purposes.