Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub API Single Commit dont fetch all files

According to GitHub Api V3 Document, to get a single commit you use this

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

I can access the api but didn't give me the right result

I should get 373 files, but I only got 300?

what's wrong, does github also have limitations when retrieving details of a single commit?

note:

I already checked my page and take a look with the commit im referring to, It shows that 373 files were changed.

Thank You for any Help!

like image 934
Francis Carillo Avatar asked Oct 30 '22 11:10

Francis Carillo


1 Answers

The GitHub API docs don’t seem to mention a specific limit on commit listings but a 300-file limit is mentioned in other places in the docs; for example, the docs for the API for listing pull-request files:

Note: The response includes a maximum of 300 files.

And in the Limits for viewing content and diffs in a repository docs:

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.

The 300-file limit is also mentioned here at Stackoverflow in other answers:

  • Large github commit diff not shown
  • github Diff Truncated error

Those both quote a GitHub rep as saying:

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.

like image 113
3 revs, 2 users 99% Avatar answered Nov 14 '22 00:11

3 revs, 2 users 99%