dolt
dolt copied to clipboard
Report schema merge conflict for incompatible tables created on each branch
If a table is created on branch1 and branch2, but has a different schema, then merge currently aborts with the following error:
table with same name 'FOO' added in 2 commits can't be merged
This happens because there is no common ancestor commit in both branches that creates the table, so Dolt isn't sure which schema is the correct one to use. Instead of halting the merge with this error message, we should treat this as a schema merge conflict and report it through the standard schema merge conflict table. This would allow users to resolve the schema conflict in the same ways as other schema conflicts and would also enable all schema merge conflicts to be identified up front – instead of fixing one, retrying the merge, potentially hitting this error for another table, etc.
I wonder if we should treat this the same as merging branches with unrelated histories. (We currently don't handle merging branches with unrelated histories, but git has an --allow-unrelated-histories tag that we could choose to implement.)
Both cases feel like fundamentally the same issue: trying to merge data when there's no common ancestor. And a solution for one could potentially work for the other.
We have #4468 for merging unrelated histories