canteen's blog

source control

Background

While mucking about with Stellaris I came across some new version control systems as well. I'm not really sure why, they're supposed to be one of those things you just use that never really change. In that respect, git does pretty well. I've used it for decades and it's essentially the same.

I briefly had the displeasure of using SVN and I also dallied with mercurial. In the end I went with git because it's just less irritating to know a tool every employer expects me to know really well.

But I've arrived there. I know it as well as I'll ever need to for work. So it is less irritating to shop around.

What I like

The ideal

The ideal version control system is one that I never see at all. If I must, then at least only when I need it (i.e. I need to go back to the past). This is why I enjoy using it.

It's also usually pretty convenient to work with other people. With a judicious amount of semantic diffing and a relatively diligent community, it can sometimes even be pleasant.

Tangent

Why it isn't the default for especially enterprise git wrappers (github enterprise, azure devops, etc) to have semantic diffs is honestly a mystery. But at least they have a reasonably fit for purpose source control tool backing them. It could be so much worse (for examples of this look no further than the way azure devops handles pipelines. A wild growth of cancerous bad ideas, like all enterprise software). Never trust a big corporation to make good software.

What I found

Back to the topic at hand, I found jujutsu. Which is essentially a layer on top of git that attempts to be pijul.

jujutsu

It sits next to and on top of git, so you can keep using whatever source control host you currently use. No migration fuss. It clones existing git repositories too, so if you move homedirs or something (why???) it's no problemo.

There's a lot to love:

pijul

When it comes to managing the history and being conceptually ready to fuck around with it, pijul is extra cool. It does not keep the history of a repository as a stack of states (which git and by extension jj do), but it keeps it as a set of patches.

It's all very mathematical but broadly speaking this makes it less likely for a given set of patches to interfere with another when you move them around. If the set of patches doesn't touch another one you never have to undertake action at all. Very cool.

Jujutsu approximates this using judicious three-way merging and being spicy and for the most part it works pretty well. It just has some fundamental limitations (f.e. it is possible for the result of two merges to be the state before the merges, even though both states you merged in ended up in a different place) that are pretty harrowing. Pijul makes that all better.

It has a webhost called the Nest where you can put your repositories. If you mostly write your own software (or if I did that I guess) and interact very little with anything on github, super great. Probably use pijul. If not, you're going to have a bad time.

It's also a little less ergonomic than jujutsu, but if you are serious about using it I think that is eminently solvable with a spicy wrapper. Doesn't even have to be that large, just a little something to approach the commit handling jujutsu has.

New things

I like the things I'm already using because I know them well. I like Python and C, I like ... okay I don't like git. But it's familiar and that's important to me too.

Pijul ended up just being too much of a departure from my comfort zone during a time when I mostly wanted to be writing a parser (casually, recreationally even).

So I picked jujutsu for now. In terms of licensing and probably every other real way it is a worse choice: It's MIT (or apache? Basically the same thing) licensed and it carries the taint of google. Both of those things are Wrong for the same reasons. I won't go into them here, both because it's off-topic and because it deserves it's own post.

But it's nice to use (significantly more so than pijul, probably until you learn it properly), fulfills it's promise of not getting in the way and making things easier. And my code goes in the same spot.

It is good enough for now :)

#code #computer