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

API Endpoint for commit comparison #17165

Open
delvh opened this issue Sep 27, 2021 · 1 comment
Open

API Endpoint for commit comparison #17165

delvh opened this issue Sep 27, 2021 · 1 comment
Labels
modifies/api This PR adds API routes or modifies them

Comments

@delvh
Copy link
Member

delvh commented Sep 27, 2021

Feature Description

We now support direct diff comparison for the web (#16635),
but it would be nice to also offer an API endpoint for that.

I think a fitting route for that would be /repos/{owner}/{repo}/git/commits/compare/{baseCommitSHA}/{targetCommitSHA},
or alternatively /repos/{owner}/{repo}/git/commits/compare/{baseCommitSHA}..{targetCommitSHA}.

The return type could be, just as for /repos/{owner}/{repo}/git/commits/{sha}.{diffType} text/plain, with the output of git diff {baseCommitSHA}..{targetCommitSHA}.

Screenshots

No response

@noerw noerw added the modifies/api This PR adds API routes or modifies them label Sep 28, 2021
@condemil
Copy link

I believe it would be beneficial to have not only diff, but also what files were changed. Here is the APIs from other services that have info about files added/modified/deleted/renamed:

https://docs.github.com/en/rest/commits/commits#compare-two-commits
https://docs.gitlab.com/ee/api/repositories.html#compare-branches-tags-or-commits
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

No branches or pull requests

3 participants