Add API for getting a diff of a specific file #14468

Open
opened 2025-11-02 11:13:42 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @nitzan-entro on GitHub (May 8, 2025).

Feature Description

Currently the commit diff api is for the whole commit content and not by files in the commits, but after looking at impl of diff api the part that gets the diff accepts also a file name, it will be really simple to add the file name to the same api as optional parameter or add another endpoint.

Screenshots

No response

Originally created by @nitzan-entro on GitHub (May 8, 2025). ### Feature Description Currently the [commit diff api](https://docs.gitea.com/api/1.23/#tag/repository/operation/repoDownloadCommitDiffOrPatch) is for the whole commit content and not by files in the commits, but after looking at [impl of diff api](https://github.com/go-gitea/gitea/blob/main/routers/api/v1/repo/commits.go#L275) the part that gets the diff [accepts also a file name](https://github.com/go-gitea/gitea/blob/main/modules/git/diff.go#L30), it will be really simple to add the file name to the same api as optional parameter or add another endpoint. ### Screenshots _No response_
GiteaMirror added the topic/apitype/proposal labels 2025-11-02 11:13:42 -06:00
Author
Owner

@nitzan-entro commented on GitHub (May 11, 2025):

Didnt really get how i can contribute code here, but if someone can merge this for it'll be delightful :)

added_an_option_to_get_a_single_file_diff_api_query_param.patch

@nitzan-entro commented on GitHub (May 11, 2025): Didnt really get how i can contribute code here, but if someone can merge this for it'll be delightful :) [added_an_option_to_get_a_single_file_diff_api_query_param.patch](https://github.com/user-attachments/files/20147869/added_an_option_to_get_a_single_file_diff_api_query_param.patch)
Author
Owner

@nitzan-entro commented on GitHub (May 11, 2025):

@kemzeb can u assist?

@nitzan-entro commented on GitHub (May 11, 2025): @kemzeb can u assist?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14468