Skip to content
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

[feature request] Add support to list commits that only affect a file path #454

Closed
dinox0r opened this issue Sep 9, 2018 · 1 comment
Closed

Comments

@dinox0r
Copy link

dinox0r commented Sep 9, 2018

Context

The GitHub API allows listing commits that only affect a file path:

https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository

This endpoint also allows further filtering using the since and until parameters:

curl --include -H "Authorization: token <TOKEN>" \
   "https://api.github.com/repos/USER/REPO/commits?path=/some/path.txt&since=2018-07-0100:00:00Z"

None of these are yet present in the library. Currently, listing commits is done thought the listCommits method, defined as:

public PagedIterable<GHCommit> listCommits() { ... }

And can be used like:

GitHub github = ...
for (GHCommit commit : github.getRepository("[some-repo]").listCommits()) {
   // ...
}

Request

Ideally, something similar to the following is desireable:

public PagedIterable<GHCommit> listCommits(String filePath, ZonedDateTime since, ZonedDateTime until) {

That only lists commits within the specified date range that only affect the given file path.

@dinox0r dinox0r closed this as completed Sep 9, 2018
@dinox0r
Copy link
Author

dinox0r commented Sep 9, 2018

Totally missed the queryCommits() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant