gpt4 book ai didi

git - 在 git 中显示提交者日期而不是作者日期

转载 作者:行者123 更新时间:2023-12-03 09:12:28 27 4
gpt4 key购买 nike

我正在使用 gitk 浏览我的 git 存储库,我想打印提交的提交日期,而不是 gitk 中的作者日期(在第三列)。

你能告诉我该怎么做吗?

enter image description here

最佳答案

修改gitk. (这是一个很大的TCL脚本,因此很容易修改。)

如果你查看最新版本的 gitk,你会发现:

proc drawcmittext {id row col} { 

第 6100 行附近。大约有 72 行左右,您会发现:

    set date [lindex $commitinfo($id) 2]
set date [formatdate $date]

没有进一步的代码可以更改date,因此从这里开始,您将陷入formatdatelindex中的初始值所做的任何事情> 表达式(列表索引)。

$commitinfo(基于查找提交 ID 的关联数组)字段是:

    set commitinfo($id) [list $headline $auname $audate \
$comname $comdate $comment $hasnote $diff]

(parsecommit 的最后两行,大约第 1730 行)。所以索引 2 是 $audate,它是解析后的作者日期。提交者日期来自索引 4(索引 1 和 3 分别是作者和提交者)。

如果使用某些命令行开关,明显的变化是选择索引 4。 (制作一个动态更改值的 Tk 按钮也是可能的,但更难。)

关于git - 在 git 中显示提交者日期而不是作者日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40819220/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com