带有*无趣*路径列表的 git bisect

标签 git git-bisect

You can pass a list of paths to git bisect这样只有提交更改这些文件才会被测试:

You can further cut down the number of trials, if you know what part of the tree is involved in the problem you are tracking down, by specifying path parameters when issuing the bisect start command:

$ git bisect start -- arch/i386 include/asm-i386

但是,我想做这两个事情:忽略只涉及某些文件的提交,比如

$ git bisect start --unrelated arch/i386 include/asm-i386

会跳过涉及 arch/i386/foo.cinclude/asm-i386/utils.s 的提交,但会包含涉及 的提交arch/i386/bar.carch/amd64/baz.c(因为后者不在列出的路径下,因此整个提交是相关的)。

有办法吗?

最佳答案

做你想做的事情的方法是使用 bisect run <script> .
像目前一样使用二分法,并将二分法与脚本选项一起使用。

脚本将返回适当的跳过代码(或 125 表示不可测试 - 更适合您的情况)。

Note that the script (my_script in the above example) should exit with code 0 if the current source code is good, and exit with a code between 1 and 127 (inclusive), except 125, if the current source code is bad.

Any other exit code will abort the bisect process. It should be noted that a program that terminates via "exit(-1)" leaves $? = 255, (see the exit(3) manual page), as the value is chopped with "& 0377".

The special exit code 125 should be used when the current source code cannot be tested. If the script exits with this code, the current revision will be skipped (see git bisect skip above). 125 was chosen as the highest sensible value to use for this purpose, because 126 and 127 are used by POSIX shells to signal specific error status (127 is for command not found, 126 is for command found but not executable---these details do not matter, as they are normal errors in the script, as far as "bisect run" is concerned).

关于带有*无趣*路径列表的 git bisect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31112179/

相关文章:

git-bisect 但对于 N 个 repo

git - 在 rebase 到 Git 中的 Master 之前与另一个功能分支 merge

git log 并显示在一个裸仓库上

c# - 在另一个项目/命名空间中使用现有源代码

git - 命令 git 中的 "develop"和 "origin/develop"有什么区别

git - 查找最近的好提交以传递给 git bisect

git - 无界 git 对分

git - 一分为二,从最初的提交

git bisect 不起作用,没有输出

git - Init.d 脚本不更新 git 存储库