非图形三向合并工具

发布于 2024-07-10 08:47:08 字数 691 浏览 5 评论 0原文

我目前使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜吻♂芭芘 2024-07-17 08:47:08

看起来 diff3 有一些有趣的选项。

在 ubuntu 上:

       -m  --merge
              Output merged file instead of ed script (default -A).

您要求非图形化,但 vimdiff 和 gvimdiff 可以做 3 个相邻的窗口。

Looks like diff3 has some interesting options.

On ubuntu:

       -m  --merge
              Output merged file instead of ed script (default -A).

You asked for non-graphical, but vimdiff and gvimdiff can do 3 adjacent windows.

知足的幸福 2024-07-17 08:47:08

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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文