1. 70
    1. 13

      Someone linked me to their codeberg repo the other day and I was amazed how slick it was. If the forgefed protocol ever really gets off the ground (cross-instance pull requests!) I think forgejo becomes unstoppable. I get that email-based patch workflows are already federated but I just haven’t got around to learning it and PRs are pretty intuitive.

      1. 8

        I did some poking around and honestly, Forgejo looks like everything I’d want out of a forge these days. I’m a bit surprised to see it even includes CI. A lot of smaller companies should probably be using this instead of Gitlab.

        1. 2

          Have the Forgejo developers shown any interest in supporting self-hosted CI runners on Windows and macOS? Or is that specifically out of scope for them because those platforms are proprietary?

          1. 2

            I believe there isn’t an active movement for using anything outside of their fork of act, however their docs state

            It is possible to use other runners instead of Forgejo runner. As long as they can connect to a Forgejo instance using the same protocol, they will be given tasks to run.

            So, technically speaking, someone could write a runner that runs on any platform that can connect and respond to the protocol (and what happens after that seems to be up to the runner itself).

            1. 2

              I may be mistaken, but I think they just don’t provide pre-built binaries for those OSes. But you should be able to build forgejo-runner on your own for them.

              1. 1

                Hah maybe I should have a crack at it. I really don’t like the act/GitHub Actions based runners, though.

                1. 1

                  I had another look and the runner seems to build fine for/on Windows.

              2. 7

                PRs are so much work compared to git send-email --to list@project.com, or piping the current email to git am.

                What may be interesting is a bridge that converts pull requests from forgefed to email, so I don’t have to ever interact with the hosting website.

                1. 26

                  The proportion of software engineers who have the living knowledge base of how to use PRs seems far greater than those possessing the knowledge of how to effectively use git send-email. Maybe it’s true that git send-email is much less work once you know it (I don’t know, never tried, only project I know of that uses it is the Linux kernel) but any “less work” analysis will have to account for the work of training others how to use it, amortized over the number of patches they send. And for open source projects seeking contributors, removing friction to initial contributions is everything.

                  1. 15

                    I really don’t think PRs are more work. I just git push myorigin, and it prints a URL. I click it and, if it’s a simple case, just click Create PR (if it’s a complicated case you have to write a cover letter, just like you do with email). It takes longer to figure out what email address to send to for git send-email than those two clicks.

                    The real benefit of forge PRs comes after the initial send. I can force push to update the PR instead of having to resend emails, as often as I want, without spamming people. Countless times I noticed a mistake after the fact and quickly fixed it without having to bother anyone.

                    All review comments on the PR are linked in one convenient place and with a rich UI where you can expand code context without having to cross-reference a code editor manually. It’s almost impossible to review complex email patches without manually digging up context (and visualizing how the patch applies mentally, unless you manually apply it for real so you can use Git tooling!). I find that this encourages “lazy” email reviews that only consider the immediate code context because it’s too much work to pull up more, which often waste everyone’s time because the comments turn out to be invalid when considered with more code context. Meanwhile, a forge PR can be reviewed entirely in the forge, pulling up as much code context as you need on demand with a couple clicks. Comments are tied to the code context, such that you can see all comments from different people on one piece of the code together, instead of having to walk through separate email subthreads. Other PRs can be linked directly and commit IDs are clickable. Reviewers can suggest code changes that can be applied directly with one click.

                    Review and commenting occurs in parallel in one place, without having to break the conversation into discrete “versions” that are re-sent as unique PRs (and often end up with duplicated discussions as new people join who missed the context). That means I can be working on discussing changes A and B while I’ve already fixed C as C’ and someone is already reviewing C’, and D is already considered good and need not be re-sent to anyone if nobody has any comments on it. The UI automatically hides obsolete comments after that particular part of the code is updated (but you can still click to read them). There is an explicit concept of “resolved” conversations so you can keep track of every review change without having to do it manually in a text file or something (or worse, in your head, and then forget a few days later if you have to set the PR aside for a bit).

                    It’s easy to enumerate at a glance open PRs for a project, and there is a consistent notion of “closed/merged”, unlike email where there’s no programmatic way of doing that that doesn’t involve parsing human language with heuristics. And anyone joining in from elsewhere can just do it, without worrying about being subscribed to the ML or CCed in advance, or else they don’t have context in their inbox and have to cross-reference an ML archive or manually import messages.

                    And actually merging the PR is way easier too, just one button click for a whole series of commits vs. using something like b4 (which isn’t even part of Git itself) to download the mbox and apply it, or doing it manually via bespoke email client workflows message by message (and then if your email client doesn’t preserve whitespace properly, you’re in trouble). Plus a PR is explicit about the base commit, while bare patches aren’t, and then you have to either guess, ask, or ask for a rebase when they don’t apply (and Git can’t do useful automatic conflict resolution without a base commit, git am just gives up, unlike a rebase where you get conflict markers etc.).

                    And then there’s the manual email editing, and the endless nested quotes. That’s just a poor workaround for lack of rich, fine-grained threading and grouping with context! It creates visual clutter and slows everything down, because if I’m reading an email thread in sequence now I have to skip over all the quotes which I just read, and if I’m looking at a leaf message far down it was probably trimmed too much and I’ll have to look at the parents for context anyway. Clearly if you have a data structure which is a set of messages and replies to specific code context points, grouped by author/review, the efficient way to manage it is like that, not flattening it out to emails with duplicate context to make it fit a medium that cannot efficiently represent that data structure. Consider that a review implies commenting on multiple pieces of code, and while there is value to grouping them together, the comments usually stand alone. But nobody does email review like that, one comment per email. They get grouped together in one reply, and then replies to that splinter off, but the email metadata does not tell you which part of the email, which review comment, the reply is a reply to. And on the other hand, when the review is of multiple commits which are related, email has no way of grouping those together, because you can only reply to individual patches. I can fit a dozen comments and replies in one screen in a forge including the original code, while with email I can only fit one message, which might or might not have arbitrary context which may or may not be what I need depending on what the authors did while trimming quotes. And I can scroll up and down through the discussion seamlessly, while with email I have to jump from message to message (or at best get a GMail type view which is just a heuristic and may not get the threading/context right). Email is just not, at all, the right data structure to do complex code reviews with.

                    There’s endless other reason to use a forge depending on what you’re doing. For example, if your project involves artwork at all, forges can display and even diff images for you, while email clients just see a huge blob of base64 (because email flows also can’t integrate with attachments, which are actually the native mechanism email has for sending files). And that’s if your change even made it to the inbox and wasn’t dropped for being too large. Some projects have multi-megabyte resources and that simply can’t work with email, while Git handles it fine, especially if it’s an efficiently delta-able binary format (or there’s git LFS, which might kind of work with email if you send the changes to the LFS blob store and only email the identifiers, but I don’t know if anyone does that and why would you do that instead of using a forge with LFS integration?). Same with better integration with CI and code quality bots (which can suggest changes or fixes, and again those can be applied without the author having to re-send the entire PR, including going through several attempts at fixing a CI problem without spamming every human in the conversation).

                    What may be interesting is a bridge that converts pull requests from forgefed to email, so I don’t have to ever interact with the hosting website.

                    There are already several solutions along these lines. You can provide email interfaces for a forge flow, because it’s easy to go from rich structured content to plain text, and degrade gracefully when replies can’t be parsed back into rich content. The converse is nearly impossible.

                    Honestly, my intuition is that PRs provide at least a several-fold improvement in overhead over email flow. And for small changes overhead dominates the overall time spent on the whole change. The PR flow is also much friendlier to newcomers (just ask people).

                    Sure, with a forge you have to create an account upfront, but that is amortized among projects using the same forge or compatible login providers (quite common these days). And quite frankly, I waste more time dealing with the overhead of a single complex email code submission and review than it takes to create a forge account from scratch, with manual email/password login (if it’s OAuth then it’s just two clicks and it beats even simple email code review overhead).

                    Source: I regularly contribute to both large forge flow projects (Mesa) and the only large notable email flow project (Linux) and I very, very much prefer the forge flow. Even for simple changes like this one which had no review comments and didn’t need any of the post-send PR flow features I just mentioned, the email flow gives me significantly more anxiety and mental overhead, and that’s using b4 prep/b4 send which is already a huge improvement over git send-email.

                    1. 3

                      You’re allowed to feel that way. I absolutely loathe the PR review UIs I’ve had to use, and I think that the foregefed protocol is a good opportunity to allow me to ignore them completely.

                      The way activitypub, (and by extension forgefed), works is already extremely analogous to email. There are already projects that serve activitypub via imap. Fully bridging to email seems quite doable, and I won’t be forced to conform to your preferred workflow.

                    2. 10

                      IMHO a major failing of the email based workflow is that it doesn’t preserve enough commit metadata. Including the parent commit ID would help figuring out conflicts as well as avoiding missing dependencies. If the exact commit could be transferred via email it would also help future merges and updates as Git would understand that the commit that you sent as a patch is the same as the one applied by the maintainer. Right now that information is lost and when merging upstream back into your branch it can become a huge pain to resolve all of these false conflicts.

                      1. 14

                        It’s also really hard to send a follow-up v2 patch that shows up in the same thread as the original. I’m a huge email fan in general, but git send-email doesn’t actually benefit from the main advantage of email flows because it doesn’t let you send using your existing mail client you already know how to use! As a result, I mess this up like 50% of the time.

                        1. 3

                          Including the parent commit ID would help figuring out conflicts as well as avoiding missing dependencies.

                          git has a way to attach this and it’s suggested eg. for kernel patches: https://people.kernel.org/monsieuricon/all-patches-must-include-base-commit-info

                          Agreed on other points.

                        2. 5

                          I just do git push origin HEAD:refs/for/main -o topic="branch-name" and let the magic of the AGit workflow do its thing (most recent example here). I do need an account on the forge, but if I plan to contribute to things hosted there, that’s a very small price to pay.

                          Other than that: I just clone the upstream repo, do my thing, and git push away. I get reviews in email, and can push my updates the same way, with a simple git push. It’s bliss, I very, very rarely have to interact with the hosting website. And even in the rare cases I do: it has an API, so I can do all my interactions through Emacs, after the initial registration.

                          Merging PRs is similarly doable without interacting with the site, and doesn’t even require anything but git itself.

                          Forgejo + AGit is <3.

                          1. 4

                            They’ve made PRs super easy, honestly. When you push to a fork the server sends back a URL to create a PR and you just fill in the title and description like you would write in an email. If there’s only one commit, those are filled in for you. That’s less work than mailing around patches for me at least.

                            1. 7

                              It’s even better when you discover the AGit workflow: you don’t even need to fork. Clone the upstream repo, branch off, do your thing, and you’re a single git push away from a PR.

                              No fork, no email, just git clone, git checkout -b, and git push.

                              1. 5

                                That’s how gerrit (which I mostly use for work) does it, and I find the GitHub PR flow so confusing and crufty in comparison.

                              2. 4

                                I like Forgejo and I think Codeberg is doing really good work there.

                                On the subject of email-based workflows… as a contributor, I like to be notified if my PR ends up having conflicts with the mainline so that I can fix them, for example. As a maintainer, I like being able to see all open PRs. I like suggestions in code reviews that contributors can just accept in one click. The list goes on. I’m not against creating PRs by email, but I really wouldn’t want to be a part of a process where git send-email to a mailing list is the only available tool.

                              3. 1

                                It’s not that hard to write tooling that makes opening a PR as easy as git send-mail.

                                The fundamental issue is that git send-mail works with email addresses, whereas PRs work with accounts on a git forge. Email addresses are in some sense more decentralized internet IDs than accounts on a git forge are; but both have serious issues.

                                1. 3

                                  You don’t even need to write any tooling, because it already exists. It’s called git. As long as you have an account on any Forgejo instance, you can just git push using the AGit workflow.

                                  No need to visit the web UI, no need for a fork. Just clone the original repo, then git push your branch, and a wild PR appears.

                              4. 2

                                My ideal Forge would be one that would offer all forms of workflow at once. You can use ForgeFed, you can send email to create “PR” and for internal developers/core team you can use stacked diffs.

                                1. 2

                                  cross-instance pull requests

                                  I’ll reserve judgement but I’m not confident this is going to be a great experience for everyone. Spammers, griefers, LLMs, all able to spring up from any domain straight into your issues and PRs, with no central account management to control abuse… It’s a tough gig.

                                  1. 2

                                    Good comparison for this would be mastodon replies. In theory anyone could spin up an instance and spam you. In practice your instance moderators do a good job on spam detection and defederating malicious instances, so this isn’t a problem

                                2. 10

                                  I had to use gitlab for contributing to Debian packaging and it was so clunky and buggy; I really hope Debian considers this too at some point.

                                  1. 8

                                    TIL, Forgejo is apparently a fork of Gitea. [source]

                                    1. 12

                                      …which is a fork of Gogs.

                                      1. 5

                                        And you can configure it to use Gerrit for code review, which is very nice

                                      2. 7

                                        I’ve recently configured Forgejo Actions to replace Woodpecker and I am simply amazed at how slick it is compared to e.g. GitLab at work or Jenkins at clients’. My only beef is that the default token is not yet authorized to push to the container repository. There’s an issue for that, though, so maybe one day.

                                        1. 2

                                          Super interesting. I’m currently in a need of CI system for my Forgejo instance and was looking in the reverse direction: I was planning to set up Woodpecker mainly because Forgejo Actions is alpha quality and Woodpecker has quite a few plugins available. Would you say Forgejo Actions does all the basic stuff reliably already and works better than Woodpecker? I’d be especially interested in what kind of problems you had with Woodpecker.

                                          1. 2

                                            None. Woodpecker seemed to work well. I just did not enjoy having a separate system with webhooks and much lower visibility. Integrated actions feel better to me. I use it for personal stuff, so I don’t exactly fret over alpha quality.

                                            OTOH, our client is migrating to Forgejo including actions soon, so I guess my tinkering will pay for itself when I inevitably end up helping out.

                                        2. [Comment removed by author]