Skip to content
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

Broken "compare n commits" link in activity overview when pushing new branch #19144

Closed
nidico opened this issue Mar 19, 2022 · 0 comments · Fixed by #19149
Closed

Broken "compare n commits" link in activity overview when pushing new branch #19144

nidico opened this issue Mar 19, 2022 · 0 comments · Fixed by #19149
Labels
Milestone

Comments

@nidico
Copy link

nidico commented Mar 19, 2022

Gitea Version

1.16.4

Git Version

2.30.2

Operating System

Debian bullseye

How are you running Gitea?

Through the 3rd party debian package repo.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Pushing to a branch which wasn't previously known to gitea leads to broken compare links like this in the activity overview

https://server/nidi/test-gitea-issues/compare/0000000000000000000000000000000000000000...f6f27fa74aaecedbcf4b4a3625ceafd6fc368ef6

This happens when doing

git push --set-upstream origin branch_name

I wasn't able to reproduce this on try.gitea.io as I stumbled over #19143 instead.

Screenshots

No response

a1012112796 added a commit to a1012112796/gitea that referenced this issue Mar 20, 2022
fix go-gitea#19144

Signed-off-by: a1012112796 <1012112796@qq.com>
zeripath added a commit that referenced this issue Mar 23, 2022
When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly. 

Therefore when creating the compare link for new branches:

1. Attempt to get the parent of the first commit and use that as the basis 
for the compare link.
2. If this is not possible make a comparison to the default branch
3. Finally if that is not possible simply do not show a compare link.

However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch.

Fix #19144

Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Mar 23, 2022
Backport go-gitea#19149

When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly.

Therefore when creating the compare link for new branches:

1. Attempt to get the parent of the first commit and use that as the basis
for the compare link.
2. If this is not possible make a comparison to the default branch
3. Finally if that is not possible simply do not show a compare link.

However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch.

Fix go-gitea#19144

Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
@zeripath zeripath added this to the 1.16.5 milestone Mar 23, 2022
zeripath added a commit that referenced this issue Mar 23, 2022
Backport #19149

When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly.

Therefore when creating the compare link for new branches:

1. Attempt to get the parent of the first commit and use that as the basis
for the compare link.
2. If this is not possible make a comparison to the default branch
3. Finally if that is not possible simply do not show a compare link.

However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch.

Fix #19144

Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly. 

Therefore when creating the compare link for new branches:

1. Attempt to get the parent of the first commit and use that as the basis 
for the compare link.
2. If this is not possible make a comparison to the default branch
3. Finally if that is not possible simply do not show a compare link.

However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch.

Fix go-gitea#19144

Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants