Compare feature with frontend and single-file diff #555

Closed
opened 2025-11-02 03:27:59 -06:00 by GiteaMirror · 14 comments
Owner

Originally created by @ghost on GitHub (Mar 21, 2017).

  • Gitea version (or commit ref): release/v1.1

Description

I cannot find a page or a button where I am able to choose two commits/tags/branches for comparsion. GitLab and GitHub provide such a feature. It is really helpful to undestand what is going on in your repo.

Originally created by @ghost on GitHub (Mar 21, 2017). - Gitea version (or commit ref): release/v1.1 ## Description I cannot find a page or a button where I am able to choose two commits/tags/branches for comparsion. GitLab and GitHub provide such a feature. It is really helpful to undestand what is going on in your repo.
GiteaMirror added the type/featureissue/confirmed labels 2025-11-02 03:27:59 -06:00
Author
Owner

@gsantner commented on GitHub (Apr 14, 2017):

Having an additonal "Compare" button (or/and a "changes since this commit") while viewing a commit would also be great

@gsantner commented on GitHub (Apr 14, 2017): Having an additonal "Compare" button (or/and a "changes since this commit") while viewing a commit would also be great
Author
Owner

@mxmehl commented on GitHub (Aug 9, 2017):

To give a bit more ideas of what I think would be helpful for a better compare feature:

At the FSFE we switched from trac/SVN to Gitea to maintain our website. With trac, our voluntary translators were able to see the diff of a file between two freely choosable commits.

For example, with the file work.en.xhtml we would like to see the difference between the current version/latest change (4e89fd20cc) and a freely choosable other date/commit (e.g. d25c06af1e).

In trac, this diff is quite helpful for translators to know which bits have changed in a file over a certain span of time to update an outdated translated version.

@mxmehl commented on GitHub (Aug 9, 2017): To give a bit more ideas of what I think would be helpful for a better compare feature: At the [FSFE](https://fsfe.org) we switched from trac/SVN to Gitea to maintain our website. With trac, our voluntary translators were able to see the diff of a file between two freely choosable commits. For example, with the file [work.en.xhtml](https://git.fsfe.org/FSFE/fsfe-website/commits/master/work.en.xhtml) we would like to see the difference between the current version/latest change (`4e89fd20cc`) and a freely choosable other date/commit (e.g. `d25c06af1e`). [In trac, this diff](https://trac.fsfe.org/fsfe-web/changeset?new=32843%40trunk%2Fwork.en.xhtml&old=29198%40trunk%2Fwork.en.xhtml) is quite helpful for translators to know which bits have changed in a file over a certain span of time to update an outdated translated version.
Author
Owner

@mxmehl commented on GitHub (Dec 12, 2017):

Can we please rename this issue, e.g. to "Compare feature with frontend and single-file diff" or so? The current title doesn't seem to catch what we discussed here.

@mxmehl commented on GitHub (Dec 12, 2017): Can we please rename this issue, e.g. to "Compare feature with frontend and single-file diff" or so? The current title doesn't seem to catch what we discussed here.
Author
Owner

@stale[bot] commented on GitHub (Feb 10, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 10, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@mxmehl commented on GitHub (Feb 10, 2019):

I would still find this highly interesting and relevant in order to make Gitea more professionally usable.

@mxmehl commented on GitHub (Feb 10, 2019): I would still find this highly interesting and relevant in order to make Gitea more professionally usable.
Author
Owner

@nunoperalta commented on GitHub (Nov 4, 2019):

I would love to see this implemented.

@nunoperalta commented on GitHub (Nov 4, 2019): I would love to see this implemented.
Author
Owner

@moay commented on GitHub (Feb 8, 2021):

Any update here?

@moay commented on GitHub (Feb 8, 2021): Any update here?
Author
Owner

@jtran commented on GitHub (May 7, 2021):

Now that #15723 is merged, scheduled for the 1.15 release, it may be what some people here are looking for. If not, I think it's one step closer.

@jtran commented on GitHub (May 7, 2021): Now that #15723 is merged, scheduled for the 1.15 release, it may be what some people here are looking for. If not, I think it's one step closer.
Author
Owner

@Arteneko commented on GitHub (Sep 12, 2021):

IMHO it isn't, as this only allows to compare tags and branches, not two commit IDs (or, in more general, two valid git commit references, it being a commit ID, a branch name, a tag, etc).

While having the UI to make this feature accessible would definitely be good, being able to properly compare between two commits of the same branch would be a good start.

Right now, it simply says "it's from the same branch, no diff", and the hard association with PRs makes it pretty unclear.

A screenshot showing "These branches are equal. This PR will be empty"

@Arteneko commented on GitHub (Sep 12, 2021): IMHO it isn't, as this only allows to compare tags and branches, not two commit IDs (or, in more general, two valid git commit references, it being a commit ID, a branch name, a tag, etc). While having the UI to make this feature accessible would definitely be good, being able to properly compare between two commits of the same branch would be a good start. Right now, it simply says "it's from the same branch, no diff", and the hard association with PRs makes it pretty unclear. ![A screenshot showing "These branches are equal. This PR will be empty"](https://user-images.githubusercontent.com/23583792/133005533-a9c4f551-ceec-45fc-8a17-acddc2727efb.png)
Author
Owner

@broukema commented on GitHub (Oct 23, 2021):

This is a good wishlist item!

Being able to use the browser interface to show the differences for a single file between two given commits would be very useful. For example, this diff

0906a1e...fe756e7

is very heavy on my browser and gave me something like a memory race condition, forcing me to reboot my computer, even though I really only want to show others the changes in a single file. (Warning: It's still heavy each time I try it; I cancel before allowing the full download.)

An incomplete solution is to use the internal section links, for example:

0906a1e...fe756e7 (diff-6)

points directly to the diff that I wish to show. The URL could be something like

0906a1e...fe756e7/gevolution.hpp

Fediverse discussion thread: https://framapiaf.org/@boud/107138988265348900

@broukema commented on GitHub (Oct 23, 2021): This is a good wishlist item! Being able to use the browser interface to show the differences for a single file between two given commits would be very useful. For example, this diff https://codeberg.org/boud/gevolution/compare/0906a1e...fe756e7 is very heavy on my browser and gave me something like a memory race condition, forcing me to reboot my computer, even though I really only want to show others the changes in a single file. (**Warning:** It's still heavy each time I try it; I cancel before allowing the full download.) An incomplete solution is to use the internal section links, for example: https://codeberg.org/boud/gevolution/compare/0906a1e...fe756e7#diff-6 points directly to the diff that I wish to show. The URL could be something like https://codeberg.org/boud/gevolution/compare/0906a1e...fe756e7/gevolution.hpp Fediverse discussion thread: https://framapiaf.org/@boud/107138988265348900
Author
Owner

@ikku100 commented on GitHub (Mar 21, 2022):

This feature would be much appreciated. I've used it a lot when using BitBucket in the past, and when using locally installed windows GUIs too. It's just that currently I am not allowed to install anything, otherwise it would be easy to work around this problem.

@ikku100 commented on GitHub (Mar 21, 2022): This feature would be much appreciated. I've used it a lot when using BitBucket in the past, and when using locally installed windows GUIs too. It's just that currently I am not allowed to install anything, otherwise it would be easy to work around this problem.
Author
Owner

@wxiaoguang commented on GitHub (Mar 12, 2025):

The description is too broad.

As of today, the comparison for branches/tags is supported. See the screenshots. You can also change the ref name to a commit ID in the comparison URL to compare commits.

If there is any new requirement, feel free to open new issues & proposals.

Image

Image

@wxiaoguang commented on GitHub (Mar 12, 2025): The description is too broad. As of today, the comparison for branches/tags is supported. See the screenshots. You can also change the ref name to a commit ID in the comparison URL to compare commits. If there is any new requirement, feel free to open new issues & proposals. <details> ![Image](https://github.com/user-attachments/assets/53a116e3-8215-42df-94fc-c617ea3e5d57) ![Image](https://github.com/user-attachments/assets/4ce737ec-86d3-4a1c-af28-be79f394c7d3) </details>
Author
Owner

@ikku100 commented on GitHub (Mar 12, 2025):

This is great, thank you!
Dumb question: do you perhaps have a version number such that I can share this with my IT department so they can upgrade gitea to the right version?

@ikku100 commented on GitHub (Mar 12, 2025): This is great, thank you! Dumb question: do you perhaps have a version number such that I can share this with my IT department so they can upgrade gitea to the right version?
Author
Owner

@wxiaoguang commented on GitHub (Mar 12, 2025):

Always use the latest one : https://github.com/go-gitea/gitea/releases

And always update in time: new releases may contain security fixes.

@wxiaoguang commented on GitHub (Mar 12, 2025): Always use the latest one : https://github.com/go-gitea/gitea/releases And always update in time: new releases may contain security fixes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#555