Git 提交日期早于主存储库
Git date of commit older than main repository
有人可以帮我解决一下 Git 日期的困惑吗?我编写 Python 脚本从 git 日志 中提取有关存储库的信息。在对大 Linux 存储库 (https://github.com/torvalds/linux) 进行测试期间,我使用 author date --pretty="%at" 作为时间戳,并在 Python 中转换为人类可读的字符串
datetime.datetime.fromtimestamp( timestamp ).strftime( '%Y-%m-%d %H:%M:%S' )
结果看起来不错,但是从这个 repo 中的所有内容中生成了两个奇怪的日期:
2001-09-17 09:00:00 aebda618718157a69c0dc0adb978d69bc2b8723c
2001-09-17 09:00:00 dbe79bbe9dcb22cb3651c46f18943477141ca452
正如信息 https://api.github.com/repos/torvalds/linux 所说,repo 是 "created_at": "2011-09-04T22:48:12Z" 我不知道这怎么可能?提交早于回购。
仅在 CMD 中使用 git log 我也检查了输出并得到了相同的结果。
Git 提交中的时间戳由用户决定。
默认 是使用计算机的当前时钟设置,这取决于用户。
在 Linux 存储库中提交 aebda618718157a69c0dc0adb978d69bc2b8723c
是这个:
commit aebda618718157a69c0dc0adb978d69bc2b8723c
Author: John Youn <John.Youn synopsys.com>
AuthorDate: Mon Sep 17 00:00:00 2001 -0700
Commit: Felipe Balbi <balbi ti.com>
CommitDate: Wed Jul 22 08:52:42 2015 -0500
usb: dwc3: Reset the transfer resource index on SET_INTERFACE
This fixes an issue introduced in commit b23c843992b6 (usb: dwc3:
gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would
only use DEPSTARTCFG once per SetConfig.
[snip]
如您所见,由 John Youn 撰写并由 Felipe Balbi 提交。可能当时 John Youn 的计算机日期是错误的,而 2015 年的日期很可能是正确的。我们无法确定;我们所知道的只是存储的时间戳是什么,而不是为什么它是那个特定值。
请注意,提交 dbe79bbe9dcb22cb3651c46f18943477141ca452
也将 John Youn 列为其作者。他还有许多其他日期为 seemingly-correct 的提交,因此很难确定,但也许他的计算机时钟在某个时候出现故障。
有人可以帮我解决一下 Git 日期的困惑吗?我编写 Python 脚本从 git 日志 中提取有关存储库的信息。在对大 Linux 存储库 (https://github.com/torvalds/linux) 进行测试期间,我使用 author date --pretty="%at" 作为时间戳,并在 Python 中转换为人类可读的字符串
datetime.datetime.fromtimestamp( timestamp ).strftime( '%Y-%m-%d %H:%M:%S' )
结果看起来不错,但是从这个 repo 中的所有内容中生成了两个奇怪的日期:
2001-09-17 09:00:00 aebda618718157a69c0dc0adb978d69bc2b8723c
2001-09-17 09:00:00 dbe79bbe9dcb22cb3651c46f18943477141ca452
正如信息 https://api.github.com/repos/torvalds/linux 所说,repo 是 "created_at": "2011-09-04T22:48:12Z" 我不知道这怎么可能?提交早于回购。
仅在 CMD 中使用 git log 我也检查了输出并得到了相同的结果。
Git 提交中的时间戳由用户决定。
默认 是使用计算机的当前时钟设置,这取决于用户。
在 Linux 存储库中提交 aebda618718157a69c0dc0adb978d69bc2b8723c
是这个:
commit aebda618718157a69c0dc0adb978d69bc2b8723c
Author: John Youn <John.Youn synopsys.com>
AuthorDate: Mon Sep 17 00:00:00 2001 -0700
Commit: Felipe Balbi <balbi ti.com>
CommitDate: Wed Jul 22 08:52:42 2015 -0500
usb: dwc3: Reset the transfer resource index on SET_INTERFACE
This fixes an issue introduced in commit b23c843992b6 (usb: dwc3:
gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would
only use DEPSTARTCFG once per SetConfig.
[snip]
如您所见,由 John Youn 撰写并由 Felipe Balbi 提交。可能当时 John Youn 的计算机日期是错误的,而 2015 年的日期很可能是正确的。我们无法确定;我们所知道的只是存储的时间戳是什么,而不是为什么它是那个特定值。
请注意,提交 dbe79bbe9dcb22cb3651c46f18943477141ca452
也将 John Youn 列为其作者。他还有许多其他日期为 seemingly-correct 的提交,因此很难确定,但也许他的计算机时钟在某个时候出现故障。