ASSERT-KTH / spork

AST-based structured merge tool for Java, fully Git compatible https://doi.org/10.1109/TSE.2022.3143766
MIT License
49 stars 6 forks source link

Add diff3 support #498

Open wetneb opened 7 months ago

wetneb commented 7 months ago

For #496.

I have added test cases (failing) with some intuitive expectations of what I would find useful as a user. I haven't thought super hard about it so I expect some cases might need adjusting.

No idea if it can be implemented, but I guess if someone wants to have a go at this, those changes should be a good start and they would only need to figure out the clever part of the algorithm.

slarse commented 5 months ago

Hi @wetneb,

Sorry about the complete blackout in communications here, I've been busy with other things. I don't think there is any good reason to merge this before there's at least a POC of outputting the base revision for the structural merge, but I don't mind leaving the PR open for some time to see if anyone is interested in looking into it.

On that note, I outlined some potential solutions to outputting the base revision in https://github.com/ASSERT-KTH/spork/issues/496#issuecomment-1943668633.

wetneb commented 5 months ago

Hi @slarse,

I have a solution that is almost ready, but it surfaced a bug in jgit's own implementation of diff3: https://github.com/eclipse-jgit/jgit/issues/38. This PR is therefore blocked by that bug, for which I have a pending fix: https://eclipse.gerrithub.io/c/eclipse-jgit/jgit/+/1177976. Once this is merged and released, this PR can then go ahead.

codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 87.37864% with 13 lines in your changes missing coverage. Please review.

Project coverage is 82.60%. Comparing base (ba76361) to head (6d9343a). Report is 9 commits behind head on master.

Files Patch % Lines
...e/kth/spork/spoon/printer/PrinterPreprocessor.java 78.26% 2 Missing and 3 partials :warning:
...rc/main/kotlin/se/kth/spork/util/LineBasedMerge.kt 57.14% 2 Missing and 1 partial :warning:
...se/kth/spork/spoon/printer/SporkPrettyPrinter.java 90.47% 1 Missing and 1 partial :warning:
src/main/java/se/kth/spork/cli/Cli.java 90.00% 1 Missing :warning:
.../kth/spork/spoon/conflict/CommentContentHandler.kt 50.00% 0 Missing and 1 partial :warning:
...kth/spork/spoon/pcsinterpreter/SporkTreeBuilder.kt 96.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #498 +/- ## ============================================ - Coverage 82.70% 82.60% -0.10% - Complexity 363 369 +6 ============================================ Files 43 43 Lines 1769 1771 +2 Branches 303 313 +10 ============================================ Hits 1463 1463 - Misses 180 182 +2 Partials 126 126 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.