三路合并算法文本算法、三路、文本

2023-09-10 23:27:45 作者:我若不努力,谁给我未来

所以,我一直工作在维基类网站。我试图决定是什么合并的同时被编辑的两个用户的一篇文章中最好的算法。

So I've been working on a wiki type site. What I'm trying to decide on is what the best algorithm for merging an article that is simultaneously being edited by two users.

到目前为止,我正考虑使用合并的文件,如果两个不相关的领域被编辑维基百科的方法,但是扔掉旧的改变,如果两次提交冲突。

So far I'm considering using Wikipedia's method of merging the documents if two unrelated areas are edited, but throwing away the older change if two commits conflict.

我的问题是:如果我有原来的文章,以及两个更改,什么是最好的算法来合并它们,然后处理矛盾,因为它们产生的呢?

My question is as follows: If I have the original article, and two changes to it, what are the best algorithms to merge them and then deal with conflicts as they arise?

推荐答案

比尔Ritcher的优秀论文值得信赖的3路合并关于一些常见的陷阱会谈,三方合并和聪明的解决办法,商业SCM软件包使用。

Bill Ritcher's excellent paper "A Trustworthy 3-Way Merge" talks about some of the common gotchas with three way merging and clever solutions to them that commercial SCM packages have used.

3路合并会自动应用所有更改每个版本(不重叠)。诀窍是自动处理尽可能多的几乎重叠区域越好。

The 3-way merge will automatically apply all the changes (which are not overlapping) from each version. The trick is to automatically handle as many almost overlapping regions as possible.