views:

157

answers:

0

I have three files with SQL INSERT statements, local base_ie_common_ancestor other.

diff3 refuses to merge local base other without conflicts since local deletes last line while other appends more stuff after last line.

Why is this a conflict? Delete the last line since base and other don't have it, append the rest from other since local and base don't have them, but no...

How to go about merging the files without manual resolution?

My best idea so far:

diff base local and diff base other append the two patches together and sort the ed operations so they go in sequence. This creates a patch file that you can apply to base to get changes from both files. I've tested, this works. However, this opens up the problem of making sure that the two patches do not modify the same lines. So, this is starting to sound more and more like a half-a$$ed attempt at duplicating the functionality of diff3 to "fix the bug."

I could use some help here. Thanks in advance!