Defeating Git Rigour Fatigue with Jujutsu

https://news.ycombinator.com/rss Hits: 14
Summary

defeating git rigour fatigue with jujutsuThis post assumes a basic level of familiarity with the jujutsu version control system. If you haven't used jujutsu, you'll still get the gist of the idea, but I recommend reading Steve's Jujutsu tutorial after.When developing a large feature, writing Good Commits is hard.And by Good Commits, I mean something like:define types add DB functions server CRUD client API client UIThis allows reviewers to step through your pull request in small bites, with each set of changes scoped to a single aspect of the feature.So, naturally, here's what I do instead:define types add DB functions WIP test code server CRUD client API and UI fix DB function fix UI bug refactor CRUD fix another UI bugLatter commits overwrite work that was done in earlier commits and the story breaks.⚖️Jujutsu makes it easier to hop around commits and iterate quickly on compartmentalized changesets, but it's still effortful and I get averse.🤖jj absorb helps somewhat, as does jj squash -i, but they both have their downsides:absorb assigns the changes based on whichever previous commit most recently touched those files, which sometimes doesn't actually correspond to which commit should own these particular changes.squash can get you stuck in merge conflict hell if your boundaries aren't extremely clean.So here's a solution to this problem of "git rigour fatigue" that I've come up with.For this example, let's represent commits visually. Imagine red represents changes to the type definitions, blue to the UI and so on:Mayhem. Our first commit is a mix of red and blue. We touch red in multiple places!To fix this, let's create our ideal commit history first, using jj new -B messy-first -m 'red'Then we can do the rest. (I switch to jj new -A red -m 'blue' at this point)Then we squash all the commits with actual changes in them into one with jj squash --from messy-first..messy-last --into messy-firstThen we use jj squash -i --from --into red and pick out the red changes, p...

First seen: 2026-05-24 21:00

Last seen: 2026-05-25 15:19