News for hackers. Stuff that matters.
Re:Jujutsu Primer by zahrevsky on Friday November 20, 2026 @02:15AM (#50571218)
What I miss is a guide on how a good commit history should look like, ideally focused on real-world examples.

There's lot's of jujutsu tutorials that teach you how to undo operations and write commit messages before the commit, but almost none cover what to do with all this power.

It's easy to name some general principles like “it should be easy to read” but I don't think it helps, especially if you're a novice like me.

Re:Jujutsu Primer by jgtrosh on Friday November 20, 2026 @02:25AM (#50571296)
Jujutsu tries to be nonprescriptibe about the end result, but my understanding of the megamerge strategy is that you want the powerful rebasing to help you manipulate many branches in parallel (fixes, features, etc), test them together, and end up with a linear history once accepted each is accepted. This isn't a real world example though.
Re:Jujutsu Primer by hdjrudni on Friday November 20, 2026 @02:27AM (#50571305)
Google offers some advice on how to write good commit messages: https://google.github.io/eng-practices/review/developer/cl-d...
Re:Jujutsu Primer by dwattttt on Friday November 20, 2026 @03:44AM (#50571901)
In practice I end up producing a branch where the commits are the kind of "ideal"; units of work that build on each other, but not interspersed with "fix something we didn't in notice in the commit a week ago".
Re:Jujutsu Primer by rlecaro2 on Friday November 20, 2026 @03:45AM (#50571908)
If the only thing you're lacking is experience, try it out! You'll develop your own judgement along the way.

jj gives you excellent tools to change your mind mid-way.

Re:Jujutsu Primer by juped on Friday November 20, 2026 @04:57AM (#50572470)
Follow the guide Git provides for contributing to itself! It's there in the source distribution, though I don't think the man pages.
Re:Jujutsu Primer by mhw on Friday November 20, 2026 @05:01AM (#50572505)
The guide I usually point people at is https://mainmatter.com/blog/2021/05/26/keeping-a-clean-git-h... . It talks about git and the Fork GUI, which I find to be great for visualising what is going on in the repository, particularly for beginners who don't have a strong mental model of the commit graph.
Re:Jujutsu Primer by jon-wood on Friday November 20, 2026 @06:30AM (#50573230)
I think you're probably overthinking things. Split your changeset into a series of commits each of which encapsulates one step along the way to achieving the overall goal of your changeset.

As an example, you might end up with "Refactor to facilitate adding feature X", "Data models for X", "API endpoints for X", "UI for X". Each of those would contain all the code/tests/documentation for each of those steps.

The nice thing about jj is that it makes it really easy to have a bunch of messy commits locally as your bouncing around the place, followed by squashing/splitting things as appropriate. In practice that first refactor commit might only come into existence very late after you've built a bunch of endpoints and done some refactoring along the way.

Re:Jujutsu Primer by epage on Friday November 20, 2026 @07:15AM (#50573673)
This is my commit style guide I wrote up based on what I've seen that makes PRs easier to review: https://epage.github.io/dev/pr-style/