New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No indication on how to bypass --limit #4888
Comments
|
Hi, thank you for the feature request, but it is by design that you must always specify the limit for fetching issues, pull request, repositories, or basically any unbounded set of data on GitHub. Having a "no limit" setting would be convenient but would also be tricky if people started using it in their workflows or scripts without giving it a second thought. For example, fetching all issues without limit from this repository would likely complete in under a minute, but fetching all issues from some other repositories I belong to could potentially take many minutes. For example, the VS Code repository currently has 124,827 issues. Since we can only ever fetch 100 issues per request, we would need 1,249 sequential requests to fetch all of these issues. Now, if you take into account the overhead of making a single API request to GitHub, then multiply that to a thousand, then also consider rate limit restrictions, you can start to understand why unbounded fetching of data over the network is rarely a good idea. So, if you need to fetch all issues from a large repository, specify a large However, we could document this restriction better, I agree! I'm going to re-classify this as a documentation issue. |
|
If there were a simple to use continue or start-from mechanism documented this would allow a work-around. |
|
@GadgetSteve Possibly, but I'm not sure how gh would display pagination info in its UI. Exposing lower-level pagination info doesn't seem like a great fit for gh right now, and if you need a way to continue paginating based on a previously fetched set, perhaps you should drop down to the GitHub API level manually where you have access to query ($endCursor: String) {
repository(owner: "cli", name: "cli") {
issues(states: OPEN, first: 100, after: $endCursor) {
nodes {
number
title
}
pageInfo {
hasNextPage
endCursor
}
}
}
} |
|
Since API returns a flag ( The json response could include a last entries with fields of: |
That sounds good in theory, but how would be output this line in machine-readable mode and expect that current scripts won't trip up over it thinking it's an issue record?
That also sounds good in theory, but the top-level data type of our |


Describe the feature or problem you’d like to solve
A number of options have a
-Lor--limitoption with defaults (20 or 30) and can be supplied with a--limit nwhere n is a positive integer option, e.g.:However, if the user needs to get a list of all of the open issue numbers they need to either guess how many there might be or supply a very high number.
Proposed solution
Either have a
--nolimitflag or allow either--limit=0or--limit=-1to mean no limit. This would allow things like pre-populating a list of all open tickets for pre-commit, etc. hooks to use to validate commit messages include only open ticket numbers without possibly doing multiple calls during the commit message processing.Alternatively, a documented mechanism to get more items when piping output could be added - to me this seems more complex to both implement and use.
Additional context
The text was updated successfully, but these errors were encountered: