4

我正在尝试比较两个存储库(一个是另一个存储库的分支),官方方式,使用compare并回到 2017-02-11:

https://github.com/bitcoin/bitcoin/compare/master@{2017-02-11}...UnitedBitcoin:master@{2017-02-11}

返回:

There isn’t anything to compare.

但是当我使用 Github GraphQL 从两个存储库中检索所有提交,然后测量交集时,我得到了 218 个共享相同的提交sha。在我用来从一个 repo 中检索提交的查询下方:

{
      repository(owner: "bitcoin", name: "bitcoin") {
        defaultBranchRef {
          target {
            ... on Commit {
              history(first: 100, since: "2017-02-11T00:00:00Z") {
                totalCount
                edges {
                  node {
                    committedDate
                    oid
                  }
                }
                pageInfo {
                      startCursor
                      endCursor
                      hasNextPage
                }
              }
            }
          }
        }
      }
    }   

这怎么解释?为什么两个结果不同?

仅供参考:对于“测量交叉点”,我的意思是我比较sha两个存储库中每个提交的 ID ()。

4

1 回答 1

1

两个分支上的日期都应该定义一个时间,如“跨时间比较提交”中所述。

但是,在您的情况下,确切的错误消息是:

There isn’t anything to compare.

We couldn’t figure out how to compare these references, do they point to valid commits?

这似乎表明分叉在 2017-02-11 中不存在。
如果将fork 与原始 repo进行比较,最早的“分叉”提交是从 2017 年 12 月开始的。
此时,fork 上没有有效的提交(即特定于 fork)。

在(因为:“2017-02-11T00:00:00Z”)和分叉开始(2017 年 12 月上旬)之间,您可能仍然会发现 268个常见提交(因为分叉仅在一个月后开始)

于 2018-02-24T23:50:56.630 回答