Add API endpoint for diff between two refs like GitHub and Bitbucket #5144

Closed
opened 2025-11-02 06:15:53 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @rafi on GitHub (Mar 28, 2020).

GitHub allows base...head diff comparison in their API action /compare and appears in their go sdk as CompareCommits with base & head arguments.

Bitbucket has a similar API action /diffstat and appears in their go sdk as RepositoriesUsernameRepoSlugDiffstatSpecGet with a 'spec' argument for things like 3a8b42..9ff173.

It would be great if someone will able to add this feature. My current use-case is analyzing the change-sets on each commit in CI.

Originally created by @rafi on GitHub (Mar 28, 2020). GitHub allows `base...head` diff comparison in their [API action /compare](https://developer.github.com/v3/repos/commits/#compare-two-commits) and appears in their go sdk as [CompareCommits](https://pkg.go.dev/github.com/google/go-github/github?tab=doc#RepositoriesService.CompareCommits) with `base` & `head` arguments. Bitbucket has a similar [API action /diffstat](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/diffstat/%7Bspec%7D) and appears in their go sdk as [RepositoriesUsernameRepoSlugDiffstatSpecGet](https://github.com/wbrefvem/go-bitbucket/blob/master/docs/DefaultApi.md#repositoriesusernamereposlugdiffstatspecget) with a 'spec' argument for things like 3a8b42..9ff173. It would be great if someone will able to add this feature. My current use-case is analyzing the change-sets on each commit in CI.
GiteaMirror added the type/proposalissue/needs-feedbackmodifies/api labels 2025-11-02 06:15:53 -06:00
Author
Owner

@Coding-Kiwi commented on GitHub (Jan 12, 2021):

Yes please! Maybe also include this data in commit webhooks?

@Coding-Kiwi commented on GitHub (Jan 12, 2021): Yes please! Maybe also include this data in commit webhooks?
Author
Owner

@wxiaoguang commented on GitHub (Dec 12, 2024):

Make API "compare" accept commit IDs #32801

Does it resolve your issue?

@wxiaoguang commented on GitHub (Dec 12, 2024): Make API "compare" accept commit IDs #32801 Does it resolve your issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5144