In getting CI/CD for this blog set up, I finally had the last straw with git submodules. I recently started playing around with git subtrees for my homelab config migration to git, and while they definitely have their own ergonomics issues, the fact that they vendor the subtree’s data in the parent makes dealing with them in CI/CD scenarios much easier.

I imagine a lot of this is easier when you’re all in the land of Github, but I’m using Github Actions vis Gitea and their “act_runner”. In my experience though, when using Gitea Actions, fetching submodules is a huge pain. If you have mixed credentials, they’re a pain. If they’re in private repositories, they’re a pain. If you’re using git+ssh and need to deal with authorized hosts, they’re a pain. (Spoiler alert, the Github Action parameter to provide authorized hosts didn’t seem to work, I ended up needing to run ssh-keyscan in the workflow to get the authorized hosts in the known_hosts file.)

Subtrees though. With subtrees, you can just pull the subtree into the parent repository, and you’re good to go. No need to worry about fetching submodules, no need to worry about credentials, no need to worry about authorized hosts. It’s all just there. The ergonomics are a little weird, but I’ve built a great workflow with Just, a fantastic make inspired command runner to get rid of the cruft. Yes, you’re vendoring the subtree’s data in the parent repository, but bits are cheap, and the simplicity is worth it.