problem: don't render large compare diff #12391

Open
opened 2026-05-03 03:07:21 +02:00 by Gusted · 1 comment
Gusted commented 2026-05-03 03:07:21 +02:00 (Migrated from codeberg.org)

Does your problem still exist on the latest Forgejo version?

Yes, the problem still exists (tested locally with the latest development version)

About your usage of Forgejo

Contributor of Forgejo
Member of the Forgejo security team.
Self-hosts Forgejo.
Co-Maintainer of Codeberg.org's Forgejo instance.

Problem description

This is issue was created as part of https://floss.social/@forgejo/116494296646568723.


Large diffs can be rendered via the compare endpoint, https://codeberg.org/forgejo/forgejo/compare/HEAD..HEAD~1. At some point they are so large that syntax highlighting them takes a lot of CPU time and the browser usually can't handle so much HTML either.

There should be a limit where with X amount of files or lines the diff is not rendered or pagination is implemented like for pull request files.

Potential workarounds

  • Timeout on the compare endpoint.

Forgejo Version

N/A

Other details about your environment (software names and versions)

N/A

Solutions

Accepted solutions to address this problem will go here

### Does your problem still exist on the latest Forgejo version? Yes, the problem still exists (tested locally with the latest development version) ### About your usage of Forgejo Contributor of Forgejo Member of the Forgejo security team. Self-hosts Forgejo. Co-Maintainer of Codeberg.org's Forgejo instance. ### Problem description This is issue was created as part of https://floss.social/@forgejo/116494296646568723. --- Large diffs can be rendered via the compare endpoint, https://codeberg.org/forgejo/forgejo/compare/HEAD..HEAD~1. At some point they are so large that syntax highlighting them takes a lot of CPU time and the browser usually can't handle so much HTML either. There should be a limit where with X amount of files or lines the diff is not rendered or pagination is implemented like for pull request files. ### Potential workarounds - Timeout on the compare endpoint. ### Forgejo Version N/A ### Other details about your environment (software names and versions) N/A ### Solutions *Accepted solutions to address this problem will go here*
mfenniak commented 2026-05-03 03:13:44 +02:00 (Migrated from codeberg.org)

I run into mini-versions of this often if I perform a manual backport of a Forgejo PR. When creating a new pull request, the base branch needs to be changed to the backport branch (eg. change forgejo to v15.0/forgejo), but to accomplish that I need to load the compare screen first and it's overly long and irrelevant at the initial load time.

Maintaining functionality of the top form to change the base branch would be important in fixing this, to maintain the ability to create such backport PRs without manual URL editing.

I run into mini-versions of this often if I perform a manual backport of a Forgejo PR. When creating a new pull request, the base branch needs to be changed to the backport branch (eg. change `forgejo` to `v15.0/forgejo`), but to accomplish that I need to load the compare screen first and it's overly long and irrelevant at the initial load time. Maintaining functionality of the top form to change the base branch would be important in fixing this, to maintain the ability to create such backport PRs without manual URL editing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/forgejo#12391
No description provided.