【问题标题】:`git log` shows notes that `git notes` doesn't`git log` 显示 `git notes` 没有的注释
【发布时间】:2014-10-29 23:18:07
【问题描述】:

我正在使用stepup 管理用于自动化版本编号和发行说明的 git 说明。

我们的一个仓库中的注释似乎搞砸了:

$ git log HEAD

commit 04c85f5ad7e5d60de8c9f0b8e08681e833751909
Author: Daniel Serodio <dserodio@i.dont.like.spam>
Date:   Wed Oct 29 15:47:55 2014 -0200

    non-deps removed

Notes (added):
    splittest beta

但是:

$ git notes show HEAD

error: No note found for object 04c85f5ad7e5d60de8c9f0b8e08681e833751909.

有人知道原因和/或解决方法吗?

【问题讨论】:

    标签: git git-notes


    【解决方案1】:

    git log 尊重配置条目 notes.displayRef 我猜你必须设置为“*”或“添加”

    要让git notes 显示它尝试

    git notes --ref=added show HEAD
    

    【讨论】:

      【解决方案2】:

      git log 尊重配置条目notes.displayRef

      确实如此。确保在您的测试中将其设置为 empty 值,否则会出现段错误(在 Git 2.30(2021 年第一季度)之前)

      已为 git notes 修复了配置解析器。

      参见Nate Avers (nateavers)commit 45fef15commit c3eb95a(2020 年 11 月 22 日)。
      (由 Junio C Hamano -- gitster -- 合并到 commit e082a85,2020 年 11 月 30 日)

      notes.c:修复notes_display_config() 中的段错误

      签字人:Nate Avers

      如果notes.displayRef 配置为无值[1],当notes.c:notes_display_config() 检查'v'是否为NULL 时,控制权应返回给调用者。 否则,git log --notes(man)git diff-tree --notes(man) 随后将在 refs.h:has_glob_specials() 调用 strpbrk() 时出现段错误NULL 第一个参数。

      [1] 示例:

      .git/config:
      [notes]
        displayRef
      
      $ git -c notes.displayRef [...]
      

      【讨论】:

        猜你喜欢
        • 2021-12-12
        • 2018-10-08
        • 2011-08-17
        • 1970-01-01
        • 2016-08-01
        • 2020-06-01
        • 2021-04-29
        • 1970-01-01
        • 2015-04-02
        相关资源
        最近更新 更多