Engineers often find themselves resolving merge conflicts manually.

Why isn't diff3 good enough to do conflict resolution automatically? Without going into the theory, I'll go over some of the issues with diff3. If you're interesting in diving deeper, you can read A Formal Investigation of Diff3.

Problems with diff3

What's been tried

Semantic merge strategies for specific languages. Here's a tool called SemanticMerge that works for #C, Java, and C.

Patch based algebras like darcs, which was an alternative version control system to git. You can read about the theory behind how darcs stored patches and resolved conflicts here.

Machine Learning for Merge Conflicts

What if we could train an algorithm on resolving common merge conflicts? We have millions of public merge conflict resolutions on GitHub as a data set. With a little magic, we could probably recreate the original diff'd conflict as well.

It seems like this is the best way to capture semantic differences across different languages – resolution that you would normally only get by parsing a language-specific AST or understanding syntax. Tricky patterns from dependency management conflicts could be easily learned and fixed.