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
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
CodeHostingSpecfor 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
forgecommand 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 appropriateCodeHostingSpec. Thegithubandgitlabcommands could internally just delegate to this new codepath.Alternatives considered
No response
Additional context
No response