Skip to content

Strange behaviors of the Sync Fork feature #33145

Closed
@changchaishi

Description

@changchaishi

Description

There is a known issue that, when in a forked repository, we use GetUpstreamDivergingInfo->GetDivergingCommits to see if the forked branch needs to be synced.

However the GetDivergingCommits will not work completely (return code 128 when the forked branch is updated) because the forked branch does not have the reference tree of the base branch in the repo path. Results in some scenarios, the Sync fork button is not shown as expected.

I would like to work on this issue, and the following is my fix design:

  • By reference to modules/git/repo_compare.go's GetCompareInfo, implement a temporary remote for the forked branch to make the git rev-list work.
  • The rev-list for the forked branch and base branch is much alike a pull request without listing the file changes but getting the summary of the commit change.

This issue is related to #32769, if this is fixed, the improved GetDivergingCommits could help the other issue.

Gitea Version

34dfc25

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Snipaste_2025-01-08_12-08-30

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

dev container from ubuntu22.04

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions