git 分支(git-分支)支持 --format 选项的确切版本是什么?

Since Which Exact Version(s) does git branch (git-branch) support the --format Option?

我发现“--format”选项非常方便。

in more detail especially the "%(refname:short)" directive within which is (at which Git ["git"] version is also unknown to me and could be considered bonus on the question) the fallback on the "--pretty=format:..." option notation, but anyway... .

问题是,这个“git branch”(“git-branch”)什么时候支持

--format="%(refname:short)

option/value?

此外,如果具体 Git 版本旁边的答案也能提供一个小测试脚本 (shell/bash) 来帮助我正式验证答案是否正确,我将不胜感激。我很感激,这个网站的条款 IIRC 没有要求,所以只是说。让我知道您是否希望为此获得赏金以及您希望赏金多高。

git-branch 在 v2.13.0 中扩展为包含来自 git-for-each-ref 的格式选项,git 在线文档首先在 v2.13.2.[=20= 中引用它]

如何找到答案

要找到它需要一些简单的侦探工作,但是 git 源代码维护得很好,所以这很有帮助。

因为我知道该功能是由 git-for-each-ref 提供的,所以我认为集成是次要的,可能不容易通过查看源代码本身找到,所以我查看了 [=12] 的文档=] 因为它会在添加功能时使用新选项进行更新。

使用文件缩小范围,使用 git-log

可以很容易地在 diff 中找到带有 --format 的最旧提交
git log -S--format -- Documentation/git-branch.txt

有了提交哈希(只有一个),然后我可以使用 git-for-each-ref 找到包含更改的标签,并由此确定包含提交的最早版本。

git for-each-ref --contains 3d9e4ce3eb

那为我提供了 v2.13.0,然后我查看了网站,发现文档的下一个可用版本是 v2.13.2。