Skip to content

Add .diff and .patch support to compare #34433

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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

badhezi
Copy link
Contributor

@badhezi badhezi commented May 12, 2025

Implements proposal #34410
Screenshot 2025-05-12 at 17 25 44
Screenshot 2025-05-12 at 17 25 37

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 12, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels May 12, 2025
@github-actions github-actions bot removed the modifies/api This PR adds API routes or modifies them label May 12, 2025
@wxiaoguang
Copy link
Contributor

Some things in my mind:

  1. It needs some tests to cover the behavior, otherwise this feature would get broken in the future.
  2. It needs to handle edge cases like the.branch.name.contains.diff, the logic should be like this:
    • Parse {ref1}...{ref2}
    • If ref2 exists, then do not trim any suffix
    • If ref2 doesn't exist and it ends with .diff or .patch, then respond the diff/patch
  3. Maybe it could add some dropdown menu items on the UI to make users could download the diff/patch by some clicks

@wxiaoguang wxiaoguang added this to the 1.25.0 milestone May 13, 2025
@wxiaoguang wxiaoguang marked this pull request as draft May 13, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants