bart
bart

Reputation: 15288

Github compare gives different results than GraphQL output

I am trying to compare two repositories (one is a fork of another), the official way, using compare and going back to 2017-02-11:

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

Which returns:

There isn’t anything to compare.

But when I use Github GraphQL to retrieve all commits from both repositories, and then measure the intersection I get 218 commits that share the same sha. Below the query I use to retrieve commits from one 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
                }
              }
            }
          }
        }
      }
    }   

How can this be explained? Why are both results different?

FYI: With "measuring intersection" I mean that I compare the IDs (sha) of each commit across both repositories.

Upvotes: 4

Views: 699

Answers (1)

VonC
VonC

Reputation: 1323115

The dates on both branches are supposed to define a time period, as explained in "Comparing commits across time".

In your case though, the exact error message is:

There isn’t anything to compare.

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

That seems to indicate the fork did not exist in 2017-02-11.
If you compare the fork against the original repo, the oldest "forked" commit is from December 2017.
There is no valid commit on the fork (ie specific to the fork) at this date.

Between (since: "2017-02-11T00:00:00Z") and the beginning of the fork (early Dec. 2017), it is possible that you would still find 268 common commits (since the fork only started a month later)

Upvotes: 1

Related Questions