News for hackers. Stuff that matters.
Re:Jujutsu for Busy Devs by nchmy on Tuesday July 22, 2025 @05:17AM (#44644801)
Yeah, I regularly have MANY "staging commits" at the same time in jj, in which I just throw ideas in that I don't want to pollute or yet know how to integrate with the other ideas. I use squash, split, interactive split, rebase etc to move lines and changes around etc...

When I eventually figure it all out, I can tidy it all up into completely coherent, discrete, sequential commits that make it look like I knew exactly what I was doing from the start, then push to remote.

Conversely git staging around stashing was always an absolute, terrifying mystery to me. I could never remember what was stored where, and would consequently end up losing work, repeating work, and, most of all, just making massive commits that make no sense.

I was sold on jj from essentially the moment I found it, but I remain routinely amazed at how much more powerful (yet simple!) it is than I realized.

Re:Jujutsu for Busy Devs by weinzierl on Tuesday July 22, 2025 @05:47AM (#44644962)
Hmm, never saw it that way. Maybe I just need a different perspective on commits. Thanks for your comment, that was insightful.
Re:Jujutsu for Busy Devs by nchmy on Tuesday July 22, 2025 @06:57AM (#44645394)
Glad to be helpful!

In my mind, in some sense, every commit can simultaneously be a stash, staging area, part of a branch and more. Because you can easily create endless branches on top of, beside, before, as merges of, etc.. any commit. And it all automatically rebases, conflicts often auto-resolve (or at least don't block you immediately).

I really don't know how to best describe it. But there's a reason that many people are quite literally evangelizing it in every post that comes up - who does this for git, or anything?

Just give it a try. And, even better, use it via jjui

Re:Jujutsu for Busy Devs by 1718627440 on Tuesday July 22, 2025 @06:11AM (#44645112)
You can use commits instead of the stash the same way in git. Isn't this just a way of using, why do you need jj for that?

You now you can give stashs a commit message?

Re:Jujutsu for Busy Devs by nchmy on Tuesday July 22, 2025 @06:49AM (#44645335)
The commit message is the least useful part of all of this.

It is just SO EASY to move, merge, split, rebase, squash etc commits, and even just individual lines and sections from within commits (via split).

And it's all even easier via jjui

I don't think there's anything any of us can really say to convince those of you who are constitutionally skeptical about it (or even allergic to it) why you should try it... If all of our fawning and evangelizing isn't enough to get you to at least give it a fair shake, then there isn't much else to be said.

Re:Jujutsu for Busy Devs by 1718627440 on Tuesday July 22, 2025 @07:13AM (#44645470)
It's just that I'm fine and also the features seam to amount only to a change in usage not in actual new features. In this case if you want to use commits instead of a stash, then you can do that just fine in git.

It's also that I want my commit hashes to be stable (because I cross-reference them) and it sounds like they wouldn't in jj, because it is kind of rebase-y?

Re:Jujutsu for Busy Devs by nchmy on Tuesday July 22, 2025 @07:50AM (#44645721)
It's the new workflows that it enables via making existing features vastly more accessible (though there are some new features, such as merge conflicts not being a showstopper).

The only thing left for me to say to folks like you who think git is just fine (or even great) is that you're in Plato's Cave. https://en.m.wikipedia.org/wiki/Allegory_of_the_cave

You just don't know what you're missing out on. But if you give it a fair shake, you'll see the light quite quickly.

Take care!

Re:Jujutsu for Busy Devs by Filligree on Tuesday July 22, 2025 @08:00AM (#44645804)
Commits in jj have both a commit has (which is unstable) and a commit id (which is not).

Generally you use the id, not the hash.

And yes, everything you can do with jj you can also do with git. It’s just that most people don’t, because it’s much harder with git, involves rebases and changing hashes, and so on.

Re:Jujutsu for Busy Devs by notmywalrus on Tuesday July 22, 2025 @08:27AM (#44646032)
I would call `jj absorb` a new feature (new if coming from git, I believe the idea was taken from hg). It moves diffs into the closest ancestor that touched those files/lines. Very useful for addressing reviews, then just `jj absorb` and watch them get squashed into the correct location.

This gets even better with octopus merges (known in the jj community as "megamerges"): open up 5 branches at the same time, address minor tweaks in any number of them, and `jj absorb` the content into the right parent branch.

Re:Jujutsu for Busy Devs by 1718627440 on Tuesday July 22, 2025 @08:39AM (#44646139)
I do use git absorb, but its true, you have to install it.

I have never tried git absorb across merges, no clue if that works.

Re:Jujutsu for Busy Devs by Filligree on Thursday July 24, 2025 @06:15AM (#44669002)
It does not, or at least not very well. Merges can't be rebased without replaying conflict resolution; since Git lacks a first-class concept of conflicts, that becomes a manual process.

Moreover, jj should be able (I haven't explicitly tried this) to autogenerate the conflict resolution in the `jj absorb` case, since it knows what the final post-merge state should be.