Skip to main content

Going SourceHut

Introduction

I use git to manage my digital stuff. I own repositories for my dotfiles, several personal projects, my password store, the source code of this blog. To synchronize the content of the repositories between devices I need a reliable repository hosting service.

For years, I used GitHub. It is well established, has an enormous user base, and offered private repositories for free. However, I have found an alternative to this service that suits me a little bit better. As a result, a couple of months ago I migrated all my repositories to SourceHut. In this article, I’m going to explain why this service seems like a better alternative for me.

SourceHut is independent

First of all, SourceHut is not owned by any big company. At the moment, GitHub is owned by Microsoft. I’m far from saying that corporate ownership is something evil and such products should be avoided at all costs. However, the users need to remember that the owner’s interests will be driving the decisions related to the development of such services. Namely, the company will do everything to make as much profit as possible. Furthermore, if the service is offered for free, there must be some other way to get the money out of their users. To name a few: they may present advertisements, harvest data for their own purposes, or offer paid subscriptions for premium features.

SourceHut is fully transparent regarding the source of funding for the service. At the moment, the service is in public alpha. As a result, payments are optional. However, all users will need to pay for the account when the beta status is reached. However, the SourceHut owners claim that users who are not able to pay will be provided with financial aid so that no one will be priced out.

The pricing itself is quite affordable. The price starts from $2 per month (or $20 per year if billed annually). From what I know, it is less than any VPS could cost you. For now, even the lowest plan gives access to all the features. Furthermore, the intended billing changes will be discussed with the community. Moreover, there are no advertisements or any form of user tracking present on the site.

The SourceHut team publishes the financial report regularly. The conclusion is simple. Even though the payment is optional, and only a fraction of users decided to pay, the service is financially sustainable.

Finally, the SourceHut is fully open source. The authors encourage the users to contribute to the development of the service. Also, everyone is free to self-host their instance on-premise, for free.

SourceHut lacks social features

GitHub provides some “social” features to its users. In particular, the stars reflect the popularity of a given repository. They are used by the recommendatIon engine to promote trending projects. The users usually star a repository if they find it useful and don’t want to forget about them. Thus, the stars function as a sort of bookmarking mechanism. Furthermore, GitHub allows watching repositories or other users. The notification feed will contain the activity of the things a user watches.

SourceHut developers decided to omit such features. The service does not offer any “popularity” metric for a hosted project. “Watching” a project is achieved in a much more traditional way. The user needs to subscribe to the mailing list related to the project. Also, there is no activity feed included on the website. Project recommendation is absent as well. The users can browse the projects hosted on SourceHut. However, the list is sorted by the most recent activity rather than by some undisclosed algorithm.

This approach might seem somewhat limiting. After all, the repository owners don’t get any means of measuring the popularity of their projects. Furthermore, the users can’t bookmark valuable repositories so that they can access them later. But when you come to think about this, it is rather an opportunity than a limitation. You are free to choose your own way of creating a list of interesting projects. It can be in form of a public blog, post on a social network, or just a plain text file for your own use. Indeed, creating a blog post with a list of valuable repositories is much more work than clicking a star button. However, you might add your own annotations and thoughts on the highlighted project. The possibilities are endless. I perceive this approach as an incarnation of the phrase less is more.

SourceHut is not viral

Did you notice that GitHub is viral? If you want to just use the code stored on the site, you are not limited. However, if you want to contribute to an existing project, you must create an account. Creating issues and commenting on existing ones are only available to registered users. To submit changes to the repository you must create the fork of the target, introduce changes there and submit a pull request to the original author. None of the above is available to anonymous users.

SourceHut workflow is built around using e-mail. Tickets to projects or patchsets can be submitted via e-mail messages. Depending on the project settings, non-authenticated users might be allowed to contribute to the project. As a result, you will not need an account if you want to fix a typo in the documentation of your favorite project. By hosting your project on SourceHut, you leave your potential contributors a choice if they want to create an account in this service or not, while still allowing them to work with you.

Since the workflow is based on e-mail, the users are not limited to the web UI provided by the service developers. Patchset reviews, commenting on the tickets, and managing the project can be done entirely from the MUA. As a result, the user can use their favorite text editor and not hurt their productivity.

Finally, the contents of the tickets and the patchset discussions contain a lot of knowledge related to the project. This knowledge might be a little less valuable than the code itself, but it is still relevant. In SourceHut, everything is stored as a mailing list. Thus, data migration in the case of changing the platform is simple. Mailbox format can be read by many programs. Thus, the information that is gathered during the development is not vendor-locked.

SourceHut is well designed

From a software engineer’s perspective, I must admit that SourceHut is extremely well designed. It is split into several components. They are divided by business cases related to managing the software project. These include, but are not limited to, Git and Mercurial repository hosting, ticket tracker, mailing list, SourceHut manual pages, CI engine, static page hosting, etc. Those components are loosely coupled and together form a functional project hosting solution.

From the frontend side, SourceHut shines as well. The page contains virtually no JavaScript code. All main functionalities do not use JS at all. Yes, the service consists of server-side rendered pages only. In 2022. There is only a single script that embeds Stripe payment forms to handle credit card payments. However, this addition is justified as the PCI-DSS certification is not only expensive but also complicated. Stylesheets are simple as well.

The UI design is clean and usable. However, it might not look “modern” to some users. There are no fancy decorations or eycandies. Just a simple and readable set of static pages, with well-thought navigation. With eyes partly shut, it might resemble the layout of GitHub. Thus the users will easily find what they need instead of wandering around the sites in the search for required functionalities.

All of the above makes SourceHut work fast and snappy. The page is responsive and performant even on mobile phones, so the mobile app is spare. In benchmarks prove SourceHut to be the fastest and lightest software forge, leaving even well-optimized GitHub behind. I have worked with BitBucket, GitLab, and GitHub over the years. I can say with all certainty that those numbers are reflected in the user-perceived performance of those services. As a result, SourceHut works much better and more seamless than most single-page applications I’ve encountered. Furthermore, SourceHut gets bonus points for working well in text-based browsers, like w3m.

Conclusion

I find SourceHut very usable and neat. It is also privacy-friendly and centered around the developer community. The cost of using the service is relatively low (and no, I’m not talking about using it for free in public alpha). On the other hand, I understand that joining SourceHut might not be viable for some projects or organizations. Switching to an e-mail-based workflow could be too much of a revolution for some teams that are greatly accustomed to pull requests hosted on GitHub and similar services. Finally, projects that rely heavily on the social features of GitHub will probably see no value in this service.

For me, however, SourceHut is the way to host my git repositories online.