jj jj jj jj jj
56 points by caius
56 points by caius
There's actually an even simpler way to accomplish this:
[aliases]
jj = []
The only disadvantage with this form is that iirc jj jj (with no other arguments) will not run the default command like jj would.
The only disadvantage with this form is that iirc jj jj (with no other arguments) will not run the default command like jj would.
Doesn't that mean that the simpler way is not actually accomplishing the same thing?
In a strict sense, sure? I mean I think it’s probably a bug — iirc the default command logic simply happens before the alias resolution logic, when they should probably be swapped. It’s possible this has even been fixed already and I have outdated information. But it accomplishes the same core functionality, does so without spawning an additional process, and IMO it’s neat that it works.
Woah. I posted the same solution in the JJ Discord nearly a year ago (09/28/25)!
Ok, actually to make the
jj jj ...typo act likejj ...you need this:[aliases] jj = ["util", "exec", "--", "jj"]actually kind of happy with this :)
I would still like a tweet-length "explain it like I'm 5" version of what Jujutsu is and why I should want it.
Context: in $DAYJOB-1 I used Git daily for 4 years. I loathe it. It's grotesquely overcomplicated for what we needed, and for what most people do with it, it isn't a decentralised VCS: it's centralised and server-based: for most users, centred on Github.
It amuses me that most Git users don't realise that "git" is a word. In British English it means "a grumpy, uncooperative and unhelpful person". Which is a great description of Git the tool.
Saying that, I have never used any other VCS, so I am ill-equipped to compare.
Jujutsu is very tricky to Google. The docs are not very helpful: they seem to be aimed at more experienced VCS users than I.
I think "git" was chosen by Torvalds specifically because it meant rude and grumpy person.
I think "git" was chosen by Torvalds specifically because it meant rude and grumpy person.
Yes, I am sure it must have been. He's lived in America for a long time but he's a European and he is presumably familiar with British English.
I occasionally mention the meaning of Git because I found this was shocking news to all my colleagues at both Red Hat and SUSE, who assumed it was some cryptic abbreviation or something. Most were mainly familiar with American English and I guess "git" is not a word in that.
jj is easier and more forgiving to learn than git. Every action is "undo"-able. Rebasing arbitrary blocks of changes is trivial. You can use jj personally without your choice of VCS "leaking" into the project itself.
Read https://jj-for-everyone.github.io/ for more!
The one caveat I'll make here is that if you edit commits after pushing a PR and push again, you end up with "silent" force pushes - which to someone who isn't already used to doing lots of rebases in git might be surprising.
At least one org I work with discourages force pushes to PRs that are still in review. Since Github lacks a good UI for performing an "interdiff", it's hard for reviewers to see what's changed since their last review. jj provides some configuration to prevent this, but it's not the default.
jj performing rebases for you all the time is one of my favorite things about it, and I actually gave a talk at my last $JOB called "jj: Always Be Rebasing". It makes so much more sense to my brain than git's immutable commit model, despite the fact that I've been using git almost exclusively at least since 2016.
Wouldn't what that org enforces is that people create several commits with abstract descriptions like "Fixed PR review" and "Fix typo", but then those who have to do a review only look at the diff view which just compares the whole PR to the main branch? At least that's what I have always seen. Specially because my employers would always squash all commits.
As a reviewer, what I do is mark each modified file as viewed, because then Git(hub/lab) will expand it again if modified since last visit.
I think jj clicked with me because it inverts de logic of having to add the relevant files to your change after you worked with them. In jj, if you edited a file, it's part of your change. That suits me best.
On a daily basis, the commands I use are:
I had the same experience, both with Git and the jj docs. Try my tutorial, it includes a sales pitch too!
Thanks!
TBH it still goes over my head. This is my level of Git usage:
Seriously.
I treated "git add, git commit, git push" as "save my work". "Git clone" means "load the work so far".
The rest -- rebasing and so on -- I never used. Merging was somebody else's problem so I never even tried to learn.
Once when I messed up, I watched our team Git expert work for nearly 2 hours to fix my screw-up. I proposed "copy the file locally, delete the repos, clone it again, put it back". This profoundly offended his dignity and sense of what was right.
After watching how long "what was right" took, I tried to make sure I never asked again. If I knew how, I removed the messed-up copy, got a new one, and copied the change back. It took 2 minutes.
What I am reading is something like "jj makes it easier to do stuff you never did and never wanted anyway" TBH.
Once when I messed up, I watched our team Git expert work for nearly 2 hours to fix my screw-up. I proposed "copy the file locally, delete the repos, clone it again, put it back". This profoundly offended his dignity and sense of what was right.
jj comes with an undo command which can be invoked with jj undo. This can undo any non-destructive operation you previously did. Feel like you messed something up? Just simply undo it. That alone makes it worth using for me.
Similar to this, when my coworkers end up with an impossible to untangle rebase, I tell them to copy their modified files to $HOME, create a new main from main, and copy their changes slowly one by one.
Thanks for the feedback, I really appreciate it! Your desired usage is totally reasonable and I can imagine Git can be maddening for it.
I think the other tutorial mentioned in the thread is more targeted at your level (though I haven’t myself looked at it deeply).
Using git feels bad. Using jj feels good. Give it an honest try at your day job for one week.
I've used cvs and svn professionally as well, and they feel much less good.
Thanks, added it to the jj config gist I maintain, https://gist.github.com/pksunkara/622bc04242d402c4e43c7328234fd01c