Context
I'm making a tool which uses the GitHub API (Useful Forks). I'm currently trying to understand the behavior I'm seeing with the compare 2 commits
api. I've gone through the following reading material:
- GitHub API
compare 2 commits
documentation - StackOverflow question #1: GitHub API - how to compare 2 commits
- StackOverflow question #2: Github Comparison View for 2 branches is incorrect?
But I'm still puzzled...
Problem
Reproducible steps:
- Confirm that this parent repository exists: https://github.com/yellowstonegames/SquidLib/network/members
- Confirm that this is one of its forks: https://github.com/manderin87/SquidLib
- Confirm that GitHub acknowledges that it's both
behind
andahead
of the parent repo: - Confirm that calling the GitHub API to compare the parent and the fork's
master
branch somehow doesn't seem to work: https://api.github.com/repos/yellowstonegames/SquidLib/compare/master...manderin87:master
The response is:
{
"message": "No common ancestor between master and manderin87:master.",
"documentation_url": "https://docs.github.com/rest/reference/repos#compare-two-commits"
}
I'm not sure I understand if this is the expected behavior or not. (And where could I find a list of all the possible error messages and what triggers them for that particular endpoint?)
Question
How am I supposed to obtain the numbers given in the screenshot above? (ahead
and behind
)
Extra question
I find it suspicious that all the forks for which this API call I'm making doesn't return an error have exactly 1379 commits behind the original repo. You can see that through my tool: https://useful-forks.github.io/?repository=yellowstonegames/SquidLib
Once again, this possibly goes toward my lack of understanding of what this api call is supposed to be returning?