commit.files result has a limit of 300 files, can I get infomation of all files?
commit.files result has a limit of 300 files.
I have a large commit that has 926 changed files and I need to list the changes.
when I use
files = commit.files
print(len(commit.files))
I got 300.
Can I get all the files?
We are at the mercy of whatever data GitHub returns here. Files is populated directly from the JSON returned. If you need to do something like that, I would suggest a local clone and using a library to work with the git data directly, such as https://www.pygit2.org/
@s-t-e-v-e-n-k @jessieyanl sorry for reopening an old issue, but - /commits/{ref} endpoint is (at least now) paginated, meaning you can get up to 3000 files per commit:
Note: If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.
That might be the same kind of pagination that had recently been supported for Repository.compare().commits: #2882
Happy to review fixes for Commit.files.