There are ways to resolve merge conflicts automatically in some cases given some assumptions, but there is no way to resolve any given merge conflict without a system that can create a correct program. I won't bore you with the formal proof for this (especially since I have no idea how to construct such a proof). Consider that some merge conflicts require new code to be written to resolve them.
For example, here's an original program:
if(foo()) {
send_money_to_oftenwrong()
}
and here's a change we would like to merge:
if(bar()) {
send_money_to_oftenwrong()
}
and here's a concurrent change we would like to merge:
if(baz()) {
send_money_to_oftenwrong()
}
How do you produce the
correct program from these conflicting changes?
---
Also for example, an unsophisticated and unsound method for automatically resolving some merge conflicts:
1. Assume that if the build and tests succeed, the program is correct. (This is the most important bit)
2. Accept all non-conflicting changes.
3. For conflicting changes, accept one side of the conflict.
4. Build and test the result. If it succeeds, merge it.
5. Otherwise, attempt the same with the other side of the conflict. If it succeeds, merge it.
6. Otherwise, it cannot be merged automatically by this method.
Note that this approach could also apply to a CRDT-based merge.