代码之家  ›  专栏  ›  技术社区  ›  Petr Skocik

使用git对分查找未生成的最新提交

git
  •  1
  • Petr Skocik  · 技术社区  · 7 年前

    我正在处理一个回购协议,其中最新的提交构建了,但旧的没有。我试着用 git bisect (我是新手)查找未生成的最新提交。

    我做的

    git bisect start HEAD non_buildable_commit
    git bisect run ./test_script #run git bisect good if the build fails, bad if it suceeds
    

    bisect run success

    1 回复  |  直到 7 年前
        1
  •  2
  •   alfunx Kevin Islas    7 年前
    git bisect start HEAD non_buildable_commit
    git bisect run ./test_script
    

    test_script :运行git bisect如果构建失败,则为good;如果构建成功,则为bad

    这不是剧本应该做的。如果提交良好(由对分定义),则脚本应以0退出;如果提交不好,则脚本应以1-127中的代码退出(125除外)。

    在您的情况下,如果构建失败,您应该退出 exit 0 ,否则 exit 1 .