Skip to content

Swap fork repos via "reparent" #34848

Open
@AdamMajer

Description

@AdamMajer

Feature Description

Sometimes it's really handy to be able to re-parent a repository. In our workflow, repository can start in one organization where it's originally created. Later, it's "moved" to a more stable organization that takes care of maintenance, backports, etc. while new features are still added in the original development org.

Moving repository from development org to stable org moves all issues, PR histories, etc. That's great if you are looking for new owner, but doesn't work if you only wish stable org to be the "origin" and the rest to be forks.

A process here would create a fork and "re-parent" the current repo in the fork. Adding an option to "reparent=true" to the repository/createFork would be sufficient here.

  1. create new fork /fork/pkg from /orig/pkg
  2. swap fork_id
  3. swap is_fork
  4. adjust num_forks +1 and -1 accordingly

And hence the fork then becomes the new parent while keeping everything in the original repo as-is

Discussed on:
https://forum.gitea.com/t/swap-fork-and-parent-repositories-but-keep-everything-else-as-is/11417

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions