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

Open
wants to merge 30 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 and removed modifies/api This PR adds API routes or modifies them labels 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
@badhezi badhezi force-pushed the dev/hezi/add-raw-diff-patch branch from 3acbb9f to bc79694 Compare May 13, 2025 19:56
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label May 14, 2025
@badhezi badhezi force-pushed the dev/hezi/add-raw-diff-patch branch from d67ae3a to afae382 Compare May 20, 2025 06:57
@badhezi badhezi force-pushed the dev/hezi/add-raw-diff-patch branch from afae382 to c80f0b9 Compare May 28, 2025 07:49
@badhezi badhezi requested a review from wxiaoguang May 30, 2025 10:07
@badhezi
Copy link
Contributor Author

badhezi commented May 30, 2025

@wxiaoguang
It should cover all head info patterns now.
also added more test cases to cover those.

@badhezi badhezi marked this pull request as ready for review May 30, 2025 10:15
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 modifies/templates This PR modifies the template files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants