GitHub的服务器reports是与发送到其服务器的某些提交关联的“推送日期”。应该是“该提交被推送的日期时间”。我想知道这是否是正确的,或者在此时间戳记过程中是否存在错误。
在Graph资源管理器中运行以下查询,我观察到据报告提交4016
已于2018-08-21T18:29:00Z推送,即在其父项的父项之前提交21af
,据报告已于2018-08-22T10:45:40Z推送。可以使用git将提交推送到其父级之前吗?
不可能修改提交。因此,提交4016
在被推送到GitHub时已经具有其父集,本身已经具有其父集。 (实际上,编写和提交时间戳建议正确,前提是它们是正确的。)而且,我也看到了在不推动其祖先的情况下将提交推送到远程的方法(阅读git书或git push手册页)。因此,我的问题。
这是查询。
{
repository(owner: "oliviercailloux",name: "CLut") {
object(oid: "4016d7b1b09e2a188fb99d30d1ca5b0f726a4a3d") {
... on Commit {
history(first: 3) {
totalCount
nodes {
oid
message
parents(first: 100) {
nodes {
oid
}
}
authoredDate
committedDate
pushedDate
}
}
}
}
}
}
这是答案。
{
"data": {
"repository": {
"object": {
"history": {
"totalCount": 13,"nodes": [
{
"oid": "4016d7b1b09e2a188fb99d30d1ca5b0f726a4a3d","message": "Intro","parents": {
"nodes": [
{
"oid": "c145866575e55309f943ad2c2b4d547b926f38d0"
}
]
},"authoredDate": "2018-08-21T18:28:49Z","committedDate": "2018-08-21T18:28:49Z","pushedDate": "2018-08-21T18:29:00Z"
},{
"oid": "c145866575e55309f943ad2c2b4d547b926f38d0","message": "Refactored into a short article","parents": {
"nodes": [
{
"oid": "21af8bffc747eaee04217b9c8bb9e3e4a3a6293d"
}
]
},"authoredDate": "2018-08-21T18:25:52Z","committedDate": "2018-08-21T18:25:52Z","pushedDate": null
},{
"oid": "21af8bffc747eaee04217b9c8bb9e3e4a3a6293d","message": "Minor (wording and a ref)","parents": {
"nodes": [
{
"oid": "f63a7c3a01123b266274728179c9cd46b41b69a5"
}
]
},"authoredDate": "2018-08-21T14:35:14Z","committedDate": "2018-08-21T14:35:14Z","pushedDate": "2018-08-22T10:45:40Z"
}
]
}
}
}
}
}
以下是相关的历史记录:
21af [reported pushed at 22 aug 10h45m40s; authored at 21 aug 14h35m14s] <- c145 [authored 21 aug 18h25m52s] <- 4016 [reported pushed at 21 aug 18h29m00; authored at 21 aug 18h28m49s]
请注意,我的问题与this one不同,因为我的问题是关于GitHub服务器设置的推送日期时间戳,而不是关于提交中存储的提交和作者日期。
在被要求获得GitHub支持时,他们只是向我证实,在此存储库中,观察到的pushedDate
值符合其内部数据,因此他们认为这不是错误。
背景 (摘自here。)
我对GitHub提供的时间戳感兴趣的原因是,我将GitHub用作受信任的时间源。提交本身包含时间戳,但是客户端可以在其中放置任何所需的时间。我需要知道实时提交到GitHub的学生作品的评分,如果迟到,将对其进行处罚。
我知道GitHub教室(我很高兴使用它)提供了一些带有时间戳的选项,但是它不允许像我想要的那样为多个提交添加时间戳。
我还知道GitHub不会通过其API提供三个月以上的事件。这对我来说没问题。我的目标是检索最近发生的事件的时间戳(例如,一个月或更长时间)。