GNU diff3 (three-way merge) gives unexpected result

情到浓时终转凉″ 提交于 2019-12-01 10:55:05

What did you expect to have?

As the article describing diff3 utility says:

... This (merging) fails to be true when all three input files differ or when only older differs; we call this a conflict. When all three input files differ, we call the conflict an overlap

Therefore, the case you've described is treated as a conflict. 'Why so?' you might ask. Because of the diff3 algorithm. Description you can find at the same page:

You can think of this (merging) as subtracting older from yours and adding the result to mine, or as merging into mine the changes that would turn older into yours

It cannot resolve differences properly because it does not have a proper context of changes being made.

I would agree with you if you're going to say that it should work using some other approach. But... it is what it is. diff3 is not perfect, I would recommend using other tools if you want to do it right as described in the article

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!