gpt4 book ai didi

GitHub API 单一提交不获取所有文件

转载 作者:太空狗 更新时间:2023-10-29 13:42:43 25 4
gpt4 key购买 nike

根据 GitHub Api V3 文档,要获得单个提交,您可以使用它

https://api.github.com/repos:owner/repo:commits/sha

我可以访问 api 但没有给我正确的结果

我应该得到373个文件,但我只得到了300个?

怎么了,github 在检索单个提交的详细信息时是否也有限制?

注意:

我已经检查了我的页面并查看了我所指的提交,它显示更改了 373 个文件。

感谢您的帮助!

最佳答案

GitHub API 文档似乎没有提到提交列表的具体限制,但在文档的其他地方提到了 300 个文件的限制;例如,the API for listing pull-request files 的文档:

Note: The response includes a maximum of 300 files.

并且在 Limits for viewing content and diffs in a repository文档:

Most of the limits below affect both GitHub Enterprise and the API.


Diff limits

Because diffs can become very large, we impose these limits on diffs for commits, pull requests, and compare views:

  • No single file's diff may exceed 3,000 lines or 100 KB of raw diff data. The total size of a diff across all files in a view may not exceed 20,000 lines or 1 MB.

  • The maximum number of files in a single diff is limited to 300.

Stackoverflow 的其他答案中也提到了 300 个文件的限制:

他们都引用 GitHub 代表的话:

We have some limits on diffs that we show in the browser in order to keep the pull request and compare pages working. Currently, we cut them off at:

  • 300 files,
  • a total diff of 1MB,
  • and an individual diff of 100KB.

If your diffs exceed the limits and can't be viewed online, you can always pull the changes locally and view the diff there. It may not be as convenient for you, but it'll get the job done.

关于GitHub API 单一提交不获取所有文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42545720/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com