gpt4 book ai didi

git - 可以让 "git mergetool"即使 merge 一个文件失败也自动继续尝试其他文件吗?

转载 作者:太空狗 更新时间:2023-10-29 14:22:11 32 4
gpt4 key购买 nike

我正在尝试为 git 构建自定义 merge 工具,它比 git 更了解特定文件。

此程序将分析在 merge 冲突期间 pop 的文件,对于其中的一些文件,在某些特定情况下,它会知道如何成功处理它们。

我这样执行这个工具:

git mergetool --tool=auto

这成功运行了我的程序。

但是,如果程序无法 merge 文件,并因此以非零退出代码退出,我会从 git 得到这个提示:

Continue merging other unresolved paths [y/n]? n

有没有办法让我配置 git,或者返回一个特定的退出代码,告诉 git 在没有用户干预的情况下继续尝试其余的文件?

即。像这样的东西:

git mergetool --tool=auto --continue-always

或者一些神奇的退出代码意味着相同的(或任何其他方式来做同样的事情)?

如果重要的话,我已经用“trustExitCode = true”配置了我的 mergetool。

最终目标是,如果发生 merge 冲突,我将首先运行 automagic 程序,然后使用正常的 merge 工具(如 KDiff3 或 Beyond Compare)手动 merge 其余文件。

最佳答案

something like git mergetool --tool=auto --continue-always, or some magic exit code that means the same (or any other way to do the same)?

否,除非您考虑修改 git-mergetool.sh直接。

Git 2.19(2018 年第 3 季度)对提示的唯一改进:之前,“git mergetool”停止并在处理完最后一个路径后给出了继续的额外提示,这并没有很有意义。

参见 commit d651a54 (2018 年 8 月 13 日)Nicholas Guriev (mymedia2) .(由 Junio C Hamano -- gitster -- merge 于 commit 03e904c ,2018 年 8 月 20 日)

mergetool: don't suggest to continue after last file

Eliminate an unnecessary prompt to continue after failed merger, by not calling the prompt_after_failed_merge function when only one iteration remains.

Uses positional parameters to count files in the list to make it easier to see if we have any more paths to process from within the loop.

关于git - 可以让 "git mergetool"即使 merge 一个文件失败也自动继续尝试其他文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43312272/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com