Skip to content

404 when comparing tags #6141

Closed
Closed

Description

@RobertKosten

name: 404 when comparing tags
about: The /compare/endpoint balks when comparing tags instead of branch names (offered through the UI)


Describe the bug
When viewing a tag the compare button offers to compare the tag to master, e.g. https://try.gogs.io/RobertKosten/example-project/compare/master...tag, which leads to a 404. It works fine when comparing branches, but tags seem to always fail (tried comparing two tags, tags with only [a-z]+).

Gogs version and commit
Gogs Version: 0.11.91.0811
Go1.12.7

Git version
1.9.1

Operating system
ubuntu 14.04.1

Database
mysql 5.5.62-0ubuntu0.14.04.1

To Reproduce
Steps to reproduce the behavior:

  1. Go to Repository page
  2. Click on 'Branch:master'
  3. Click on 'Tags'
  4. Click on any {tagname}
  5. Click on green compare button to the left on 'Tree: {tagname}'
  6. See 404

Can you reproduce the bug at https://try.gogs.io?
No, because I cannot clone and there seems to be no way to create a tag through the UI.

Expected behavior
A comparison between tag and branch/tag/etc. is displayed, just like between branches.

Actual behavior
404

Screenshots
Let's no go overboard, no? ;-)

Additional context
[TRACE] Template: status/404

Activity

  1. unknwon commented on May 1, 2020

    @unknwon
    Member

    Thanks for the feedback!

    When viewing a tag the compare button offers to compare the tag to master,

    Which button? Can you provide a screenshot?

    No, because I cannot clone and there seems to be no way to create a tag through the UI.

    Why can't? You can create "release" which creates a tag or just git push --tags from your local repository.

  2. RobertKosten commented on May 1, 2020

    @RobertKosten
    Author

    Thanks for the feedback!

    Thanks for gogs ;-)

    When viewing a tag the compare button offers to compare the tag to master,

    Which button? Can you provide a screenshot?

    Sure, here it is on my local installation:
    6141

    No, because I cannot clone and there seems to be no way to create a tag through the UI.

    Why can't? You can create "release" which creates a tag or just git push --tags from your local repository.

    I have created a release testone: https://try.gogs.io/RobertKosten/example-project/compare/master...testone

    I can't clone to local (I have added my ssh key, of course):

    $ git clone [email protected]:RobertKosten/example-project.git
    Cloning into 'example-project'...
    ssh: connect to host try.gogs.io port 22: Connection timed out
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
  3. added
    💊 bug
    and removed
    status: needs feedback
    on May 1, 2020
  4. unknwon commented on May 1, 2020

    @unknwon
    Member

    I can't clone to local (I have added my ssh key, of course):

    Turns out to be a problem when requests are proxied by Cloudflare, I have disabled it for try.gogs.io, should work after few hours. 😞

  5. added this to the milestone on May 1, 2020
  6. RobertKosten commented on May 1, 2020

    @RobertKosten
    Author

    I can't clone to local (I have added my ssh key, of course):

    Turns out to be a problem when requests are proxied by Cloudflare, I have disabled it for try.gogs.io, should work after few hours. disappointed

    Nice :-P

  7. zhukovra commented on Oct 8, 2020

    @zhukovra
    Contributor

    @unknwon it isn't any Cloudflare or IIS problem. Steps to reproduce:

    1. Open repository homepage
    2. Select tag on branch dropdown, you'll see repository view on that tag
      image
    3. Click on compare button - 404 at path /user/repo/compare/branch...tag
  8. unknwon commented on Oct 9, 2020

    @unknwon
    Member

    @unknwon it isn't any Cloudflare or IIS problem.

    I was quoting the SSH clone problem of try.gogs.io :) not the bug itself.

  9. oscarmlage commented on Jan 12, 2022

    @oscarmlage

    Dunno if it's something related, but the compare button hardcodes master branch in the generated url even if it doesn't exists. I mean my repo works with main (no master at all), and when trying to compare a fork with the original, the button generates this url:

    That url gives a 404. But if I change master by main in the url, as the following, it works perfectly:

    I cound'nt find any config option for changing this as default behaviour.

  10. removed this from the milestone on Mar 5, 2022
  11. locked as resolved and limited conversation to collaborators on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    💊 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions