【问题标题】:What does the last line of git bisect output mean?git bisect 输出的最后一行是什么意思?
【发布时间】:2015-07-02 13:55:48
【问题描述】:

我刚刚运行了一个 Git bisect 并得到以下输出:

547b115c69ab2ac7fde285c9b5653cbd8309a930 is the first bad commit
commit 547b115c69ab2ac7fde285c9b5653cbd8309a930
Author: Václav Slavík <vaclav@slavik.io>
Date:   Sat Mar 14 13:35:32 2015 +0100

    Use a floating tool window for Find

    Keep the window on top of the parent frame at all times, don't show it
    in taskbar and use the small "inspector" window decorations on OS X. The
    latter is what couldn't be accomplished with wxDialog, so change to
    using wxFrame and make the necessary changes.

:040000 040000 b1ed63b681bd41f924cbcf8214d65b65d7c2ea48 958a44d35851dae34b62d198a6b7f5685f490c89 M  src

我什么都懂,除了:

040000 040000 b1ed63b681bd41f924cbcf8214d65b65d7c2ea48 958a44d35851dae34b62d198a6b7f5685f490c89 M   src 

040000”是什么意思?哈希指的是什么?

【问题讨论】:

    标签: git git-bisect


    【解决方案1】:

    这是关于第一个错误提交中的路径参数,该参数的更改会触发错误。

    如果您知道要跟踪的问题涉及树的哪一部分,则可以通过指定路径参数进一步减少试验次数

    你可以在“Fighting regressions with git bisect”看到更多:

    在这样的几个步骤之后,“git bisect”最终会找到第一个错误提交:

    $ git bisect bad
    2ddcca36c8bcfa251724fe342c8327451988be0d is the first bad commit
    commit 2ddcca36c8bcfa251724fe342c8327451988be0d
    Author: Linus Torvalds <torvalds@linux-foundation.org>
    Date:   Sat May 3 11:59:44 2008 -0700
    
        Linux 2.6.26-rc1
    
    :100644 100644 5cf82581... 4492984e... M      Makefile
    

    哈希是与作为参数传递的 blob 或树相关联的 SHA1(SHA1 表示良好的提交,而 SHA 表示第一次错误的提交),以便于进行差异。

    在您的情况下,“040000”是一种文件模式,是以下之一:

    • 100644 用于文件(blob),
    • 100755 用于可执行文件(blob),
    • 040000 用于子目录(树),
    • 160000 用于子模块(提交),或
    • 120000 用于指定符号链接路径的 blob

    【讨论】:

    • 对分是在 github.com/vslavik/poedit 存储库的本地副本上完成的。我以git bisect start &amp;&amp; git bisect good v1.7.5-oss &amp;&amp; git bisect bad 开始对分。所以我希望在最终输出中看到 ce8a284 和 547b115 ,而不是 b1ed63b 和 958a44d ,它们根本不涉及任何提交。那么什么是 b1ed63b 和 958a44d?
    • @AlexHenrie:没有 b1ed63b 是 blobtree 的索引,而不是 commit 的索引。 b1ed63b 引用了使测试失败的 repo 对象(此处为 blob)。开头的 547b115 是第一个错误提交。请记住,提交引用的树引用了其他树或 blob (pointsoftware.ch/wp-content/uploads/2012/07/18333fig0301-tn.png)。在 bisect 输出结束时,您会看到 blob 或树的 SHA1,而不是提交。
    猜你喜欢
    • 1970-01-01
    • 2012-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-20
    相关资源
    最近更新 更多