Skip to content

Add Support for Forgejo / Codeberg #1782

Description

@ammrat13

Problem

I've been using Git Town to manage my branches. It's very similar to Git Machete, sharing the same goal of making stacked PRs easier to deal with. It appears Git Machete is more established, so I may want to switch to it.

Unfortunately, I host most of my code on Codeberg (a Forgejo instance), and Git Machete doesn't support it. Git Town supports it, along with Gitea and Bitbucket. I want to be able to create and checkout PRs on Codeberg just like I can with GitHub.

Proposed solution

I haven't used Git Machete, so I can't really comment about proposed solutions. I will say that a lot of these code-hosting services seem interchangable. Skimming over the code, it seems to reflect that, so it shouldn't be too bad to add another forge (famous last words). Naively I would think you'd just need to create a new CodeHostingSpec for Forgejo and wire it in. The token can be pulled the same way GitHub pulls its tokens, while the instance URL could live in the git configuration since it's not sensitive.

More ambitiously, I'd propose a forge command to abstract over all GitHub-like forges, including GitLab and Forgejo. It could pull the forge type from the git config and route to the appropriate CodeHostingSpec. The github and gitlab commands could internally just delegate to this new codepath.

Alternatives considered

No response

Additional context

No response

Activity

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

    featureNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions