Why I Use Sourcehut

A few people I know were asking why I prefer Sourcehut over GitHub or other similar git hosts, let's dive into why.

Why I Use Sourcehut

A few people I know were asking why I prefer Sourcehut over more popular Git hosting services such as Github or even Gitlab. There's a few reasons why I've started using it and prefering it more than more popular services, and this post should hopefully clear up why exactly I prefer to use it over other services as of recently.

Open Source vs Proprietary

GitHub (and implicitly Microsoft) are obviously trying to provide a service to host open source projects, but to me there's one fatal flaw with what they're doing, or rather how they're doing it. This flaw being that the platform itself is not open source. I find it somewhat hypocritical of the platform and company behind it to provide a service to host open source projects when the platform itself is not; More over, unlike quite literally every other service including Gitlab, there is no free way to self host a version of the site yourself. The only "self-hosted" option for GitHub is the enterprise version in which requires a license, and there's no way of obtaining this without paying.

Practically almost all other Git hosting services are open source, for example: Gitlab, Gitea, Gogs, and Sourcehut are all not only open source, but provide a way to self host a version of the product/platform yourself if you feel the need to do so. This is not only important to me because it allows me to see how the platform works, but it allows me to contribute to the platform itself, as well as host a development environment for friends, or a development group without paying a fortune.

So why use Sourcehut specifically?

Glad you asked. While there are other options, being easier to self host than Sourcehut itself, there's specific perks it has that keep me "hooked" in a sense to using it. Let's go over why I've been specifically hooked to the platform.

Simplistic User Interface

While the UIs of other platforms are certainly nice and modern, they all feel like a rip-off or copy of another platform, and while I could see the reason for this being so you're comfortable using the product, this to me at least feels repetitive and old, and recently I've been craving something different.

As an example of what I mean, let's take a look at GitHub's UI:

github screenshot

This is a good UI, and for the most part I like it, it's nice, dark, easy to understand and follow, but if we take a look at a different product for example say something like Gogs:

gogs screenshot

It honestly starts to look like a copy of GitHub, this feels repetitive and at least to me, kind of bloat-y. It feels like they just copied GitHub because there is no self-hosted version of the product! This is what i'd like to call "product hell", when you don't provide an alternative or similar for your product so people make copy products to satisfy the thirst for one.

Now let's take a look at a screenshot of how Sourcehut's repository interface looks:

sourcehut screenshot

This is refreshing, it doesn't feel like a copy of the other 2, it's still quite easy to follow and understand, it's minimal and isn't distracting, as well as follows some older stylistic preferences, which I've personally grown to love.

Continuous Integration

Let's start off with how the configuration format for GitHub vs Sourcehut look when it comes to CI. I'll start off with one of my project's configurations, specifically spring. The one on GitHub is so long that I personally have to put it in a paste. Compared to one I've used in the past on Sourcehut for example:

image: alpine/edge
packages:
- rustup
sources:
- https://git.sr.ht/~pyxel/crate
tasks:
- setup: |
    cd crate && git checkout -q dev
    rustup-init -y --profile default --default-toolchain nightly
- build: source /home/build/.cargo/env && cd crate && cargo build --release
- test: cd crate && ./target/release/crate --help

Look how small this is! The configuration here is so straight forward and this is honestly one thing I really love about Sourcehut overall. More over they provide more distros and operating systems such as FreeBSD and even Plan9!

One thing I've noticed when working with GitHub's CI stuff is you have to be quite round about if you want to share build artifacts between jobs, not steps, jobs. For example for my spring repository, I have to upload the build artifacts from the build step, then redownload them in the test step to run them. This is honestly so hacky to me and I honestly really hate it. Sourcehut on the other hand doesn't necessarily have "jobs", steps on Sourcehut are technically your "jobs", and you can run multiple shell commands under a single step using the | operator that's native in YAML. And each step/job is ran on the same VM instance, meaning you don't need to do some pesky round-about way to share artifacts between each fucking step!

More than just Git

Another big thing that is honestly really cool to me: Sourcehut not only has support for Git, but Mercurial as well, and get this: since Sourcehut is open source, the mercurial hosting module of it is entirely community maintained. This is one thing I love about the platform, is a lot of stuff is not maintained by some coporate entity or single person, it's very much maintained by the community as well!

Conclusion

Hopefully this provides some insight about why I've started to adore and use the platform more than the other popular alternatives. It's personal preference at the end of the day but the simplisity of using the service is honestly great to me, and if other platforms were as easy and simplistic to use, I'd gladly use them more. Less time out of my day trying to get something to work, and more of my time actually working on each of my projects.