非图形三向合并工具
我目前使用 RCS 的合并命令进行 3 路合并,但有一件事一直让我烦恼。 如果我使用 -A
选项,两个文件中所做的相同更改将显示为冲突:
<<<<<<< file1
file1 line 1
||||||| orig
orig line 1
=======
file2 line 1
>>>>>>> file2
orig line 2
<<<<<<< orig
=======
line added in both changes
>>>>>>> file2
orig line 3
如果我使用默认值 (-E
),则这些相同的更改不会显示,但输出仅显示两个贡献者,而不是祖先,如下所示:
<<<<<<< file1
file1 line 1
=======
file2 line 1
>>>>>>> file2
orig line 2
line added in both changes
orig line 3
是否有一些程序本质上会执行与 RCS 合并相同的行为,但有某种方式显示冲突中的所有三个版本,同时自动合并相同的版本变化?
I currently use RCS' merge command to do 3-way merges, but one thing has always annoyed me about it. If I use the -A
option, the same change made in both files shows up as a conflict:
<<<<<<< file1
file1 line 1
||||||| orig
orig line 1
=======
file2 line 1
>>>>>>> file2
orig line 2
<<<<<<< orig
=======
line added in both changes
>>>>>>> file2
orig line 3
If I use the default (-E
) then those identical changes are not shown, but then the output only shows the two contributors, not the ancestor, something like this:
<<<<<<< file1
file1 line 1
=======
file2 line 1
>>>>>>> file2
orig line 2
line added in both changes
orig line 3
Is there some program that will essentially do the same behaviour as RCS merge, but has some way of showing all three versions in conflicts while automatically merging identical changes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 diff3 有一些有趣的选项。
在 ubuntu 上:
您要求非图形化,但 vimdiff 和 gvimdiff 可以做 3 个相邻的窗口。
Looks like diff3 has some interesting options.
On ubuntu:
You asked for non-graphical, but vimdiff and gvimdiff can do 3 adjacent windows.
KDiff3 是图形化的,但它确实有一个“--auto”选项,当从命令行调用时,仅在发生冲突时才会执行合并并显示 GUI。 我知道这意味着您仍然需要 GUI,但 kdiff3 在命令行中仍然有用。 我一直这样使用它(在 Windows 上 - 不确定其他版本)。
(我想将此评论添加到其他 KDiff3 帖子中,但不知道该怎么做 - 抱歉。)
KDiff3 is graphical, but it does have an "--auto" option that, when called from the command line, will perform the merge and show the GUI only if a conflict occurs. I know that means you still need a GUI, but kdiff3 can still be useful from the command line. I use it that way all the time (on Windows - not sure about other versions).
(I wanted to add this comment to the other KDiff3 post, but couldn't work out how to do it - sorry.)