Feature: Allow comparison of tags, etc. #1689

Closed
opened 2025-11-02 04:09:40 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @ypnos on GitHub (Apr 10, 2018).

Description

Right now the comparison functionality is unnecessarily constraint. It only allows to compare branches, but not tags or single commits. Comparing to tags would be a very useful feature; e.g. to view changes since last release, or compare different releases.

  1. Allow to provide tag names for comparison, e.g. https://try.gitea.io/hans/testa/compare/master...funny or https://try.gitea.io/hans/testa/compare/master...tag:funny

  2. Provide green comparison button for tags as well as branches, e.g. the button is currently present here:
    https://try.gitea.io/hans/testa/src/branch/master
    but not here:
    https://try.gitea.io/hans/testa/src/tag/funny

  3. While we are at it, also provide the functionality for commit hashes, e.g.
    https://try.gitea.io/hans/testa/compare/bd0928b003...master

This is also related to #1352

Originally created by @ypnos on GitHub (Apr 10, 2018). - Gitea version (or commit ref): current - Can you reproduce the bug at https://try.gitea.io: - [x] Yes, e.g. https://try.gitea.io/hans/testa/src/tag/funny ## Description Right now the comparison functionality is unnecessarily constraint. It only allows to compare branches, but not tags or single commits. Comparing to tags would be a very useful feature; e.g. to view changes since last release, or compare different releases. 1. Allow to provide tag names for comparison, e.g. https://try.gitea.io/hans/testa/compare/master...funny or https://try.gitea.io/hans/testa/compare/master...tag:funny 2. Provide green comparison button for tags as well as branches, e.g. the button is currently present here: https://try.gitea.io/hans/testa/src/branch/master but not here: https://try.gitea.io/hans/testa/src/tag/funny 3. While we are at it, also provide the functionality for commit hashes, e.g. https://try.gitea.io/hans/testa/compare/bd0928b003...master This is also related to #1352
GiteaMirror added the issue/confirmedtype/feature labels 2025-11-02 04:09:40 -06:00
Author
Owner

@stale[bot] commented on GitHub (Jan 28, 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 (Jan 28, 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

@elesiuta commented on GitHub (Oct 28, 2020):

I am interested in this feature as well, and it looks like 3 has already been implemented at some point.

As for always showing the compare button, it should be fine to just remove .CanCompareOrPull from here? 946bbbe9b5/templates/repo/home.tmpl (L65) The compare page already seems to be able to properly detect if a pull request is possible when branches are selected anyways.
compare commits: d65d89183f...48c5663c5f
compare branches: https://try.gitea.io/davidak/youtube-dl/compare/master...download-server
compare commits across different branches: 416da574ec...36ef9d9509

However, I'm not sure how to add the ability to enter (and possibly search and select) commits from the branch drop down on the compare page, or if there's a better way to implement the user interface for this? An alternative to just make editing the url easier could be adding copy buttons next to commits like github has https://github.com/go-gitea/gitea/commits/master since the text can't be selected from the hash.

@elesiuta commented on GitHub (Oct 28, 2020): I am interested in this feature as well, and it looks like 3 has already been implemented at some point. As for always showing the compare button, it should be fine to just remove `.CanCompareOrPull` from here? https://github.com/go-gitea/gitea/blob/946bbbe9b55831ede80518ff4177f940b303a674/templates/repo/home.tmpl#L65 The compare page already seems to be able to properly detect if a pull request is possible when branches are selected anyways. compare commits: https://try.gitea.io/davidak/youtube-dl/compare/d65d89183f...48c5663c5f compare branches: https://try.gitea.io/davidak/youtube-dl/compare/master...download-server compare commits across different branches: https://try.gitea.io/davidak/youtube-dl/compare/416da574ec...36ef9d9509 However, I'm not sure how to add the ability to enter (and possibly search and select) commits from the branch drop down on the compare page, or if there's a better way to implement the user interface for this? An alternative to just make editing the url easier could be adding copy buttons next to commits like github has https://github.com/go-gitea/gitea/commits/master since the text can't be selected from the hash.
Author
Owner

@nodiscc commented on GitHub (Mar 1, 2021):

As I just discovered, commit/branch/tag comparison already works, it can be accessed from the /branches page under each repo then clicking on New pull request (the compare page is shown with a button to start a new pull request). Commits/branches/tags can all be compared by changing the URL tip...base.

ability to enter (and possibly search and select) commits from the branch drop down on the compare page, or if there's a better way to implement the user interface for this?

Also not sure about commits (showing all commit hashes under the dropdown menu would be rather bad), but I think tags should appear in the dropdown.

@nodiscc commented on GitHub (Mar 1, 2021): As I just discovered, commit/branch/tag comparison already works, it can be accessed from the `/branches` page under each repo then clicking on `New pull request` (the compare page is shown with a button to start a new pull request). Commits/branches/tags can all be compared by changing the URL `tip...base`. > ability to enter (and possibly search and select) commits from the branch drop down on the compare page, or if there's a better way to implement the user interface for this? Also not sure about commits (showing all commit hashes under the dropdown menu would be rather bad), but I think tags should appear in the dropdown.
Author
Owner

@zeripath commented on GitHub (Mar 1, 2021):

We need to add a .. compare endpoint that does git diff a..b instead of a...b.

It should not be too difficult to add but for the fact the compare endpoint is rather convoluted.

@zeripath commented on GitHub (Mar 1, 2021): We need to add a .. compare endpoint that does git diff a..b instead of a...b. It should not be too difficult to add but for the fact the compare endpoint is rather convoluted.
Author
Owner

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

Anyone following this thread, you may be interested in PR #15695, which was recently merged, and a new PR #15723. This latest PR doesn't exactly implement number 2 above, but it's an alternate UI for selecting tags to compare. Please help test and review it.

There's another issue for two-dot compare #12349, and that would be nice. But I don't think that should block movement here, especially based on what GitHub's UI does.

@jtran commented on GitHub (May 4, 2021): Anyone following this thread, you may be interested in PR #15695, which was recently merged, and a new PR #15723. This latest PR doesn't exactly implement number 2 above, but it's an alternate UI for selecting tags to compare. Please help test and review it. There's another issue for two-dot compare #12349, and that would be nice. But I don't think that should block movement here, especially based on what GitHub's UI does.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1689