三路合并算法文本 [英] Three Way Merge Algorithms for Text

查看:710
本文介绍了三路合并算法文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于三路合并算法文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆