Split a file with conflict markers

倖福魔咒の 提交于 2019-12-22 05:23:07

问题


I am looking for a tool that will split a file that has conflict markers into the two separate files. Is there anything out there that does this already?


回答1:


xxdiff can do that:

xxdiff --unmerge myfile.txt

it also works if the conflict markers result from a 3-way diff

xxdiff --unmerge3 myfile.txt



回答2:


The tool I work for (ECMerge) does that, primarily with the target of helping you to merge them visually of course. You could as well save the left/right/ancestor files with the built-in Javascript engine. ECMerge reads markers for most 'well-known' source code controls (CVS, git, mercurial, bazaar, SubVersion, Perforce, those compatible with the previously cited and of course its own markers!).




回答3:


Winmerge does that, they call it "Resolve conflict files". It only works on Windows though.




回答4:


As requested, my own solution to my question was to create the following Perl script.

http://github.com/quincy/Unmerge-Conflicts



来源:https://stackoverflow.com/questions/9894114/split-a-file-with-conflict-markers

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