Skip to content

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

Closed
@dinox0r

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions