【发布时间】:2020-10-23 16:18:08
【问题描述】:
上下文
我正在制作一个使用 GitHub API (Useful Forks) 的工具。我目前正在尝试了解我使用compare 2 commits api 看到的行为。我已经阅读了以下阅读材料:
- GitHub API
compare 2 commitsdocumentation - StackOverflow 问题 #1:GitHub API - how to compare 2 commits
- StackOverflow 问题 #2:Github Comparison View for 2 branches is incorrect?
但我还是很疑惑……
问题
可重现的步骤:
- 确认此父存储库存在:https://github.com/yellowstonegames/SquidLib/network/members
- 确认这是它的一个分支:https://github.com/manderin87/SquidLib
- 确认 GitHub 承认它是父 repo 的
behind和ahead: - 确认调用 GitHub API 来比较父分支和分支的
master分支似乎不起作用:https://api.github.com/repos/yellowstonegames/SquidLib/compare/master...manderin87:master
回复是:
{
"message": "No common ancestor between master and manderin87:master.",
"documentation_url": "https://docs.github.com/rest/reference/repos#compare-two-commits"
}
我不确定我是否理解这是否是预期的行为。 (我在哪里可以找到所有可能的错误消息的列表,以及针对该特定端点触发它们的原因?)
问题
我应该如何获得上面屏幕截图中给出的数字? (ahead 和 behind)
补充问题
我发现 所有 我正在为其进行此 API 调用的分支没有返回错误 恰好 1379 次提交在原始存储库后面是可疑的。你可以通过我的工具看到:https://useful-forks.github.io/?repository=yellowstonegames/SquidLib
再一次,这可能是因为我对这个 api 调用应该返回什么缺乏了解?
【问题讨论】:
标签: git github github-api