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 · 2 comments
Open

API Endpoint for commit comparison #17165

delvh opened this issue Sep 27, 2021 · 2 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail 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

@wxiaoguang
Copy link
Contributor

Make API "compare" accept commit IDs #32801

Does it resolve your issue?

@wxiaoguang wxiaoguang added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail modifies/api This PR adds API routes or modifies them
Projects
None yet
Development

No branches or pull requests

4 participants