Leopold Fajtak's Homepage

Suckless software maintenance

Leopold Fajtak

Suckless software is created to be inviting to be modified an recompiled by it’s users. In fact, suckless even hosts patches contributed by such users on their own website. In order to maintain your newly patched on modified version, you will want to work in a git repository with two remotes - one being Suckless, the other one of your own. If you also tend to forget the commands needed for such a setup, this guide is for you!

Setup

Let’s say we want to install st, Suckless’ excellent terminal emulator. We start by cloning the repo from Suckless

    git clone https://git.suckless.org/st

Since we will work on our own remote way more often, it will be better to declare that one as origin. We’ll give Suckless’ remote the name suckless In my case, the personal remote I want to work with is git@github.com:leopoldfajtak/st.git - you will need to replace that with yours

    git remote set-url origin git@github.com:leopoldfajtak/st.git
    git remote add suckless https://git.suckless.org/st

Now we just need to create a branch for our customizations, and we’re done.

    git checkout -b custom
    git push -u origin custom

By using -u the first time we push to custom, a reference will be left in the branch, such that git push when executed on custom there will always push to origin.

Patching

Patches can be applied using

    patch < [your_patch_file.diff]

Merging updates from Suckless

We can pull the newest version from Suckless to our master branch with

    git pull suckless master

and proceed as in the previous section after having merged master into custom.

Further note: Any conflicts can be manually resolved using git mergetool.