Most active commenters
  • steveklabnik(14)
  • baq(11)
  • adastra22(9)
  • BeetleB(9)
  • 1718627440(8)
  • stavros(5)
  • sunshowers(4)
  • KallDrexx(3)
  • nchmy(3)
  • senekor(3)

←back to thread

Jujutsu for everyone

(jj-for-everyone.github.io)
434 points Bogdanp | 148 comments | | HN request time: 0.408s | source | bottom
1. marcuskaz ◴[] No.45084298[source]
> Jujutsu is more powerful than Git. Despite the fact that it's easier to learn and more intuitive, it actually has loads of awesome capabilities for power users that completely leave Git in the dust.

Like? This isn't explained, I'm curious on why I would want to use it, but this is just an empty platitude, doesn't really give me a reason to try.

replies(7): >>45084316 #>>45084327 #>>45084439 #>>45084678 #>>45088571 #>>45092597 #>>45093098 #
2. jennyholzer ◴[] No.45084316[source]
I agree. I'm willing to give them the benefit of the doubt to some extent because existing Git UIs are pretty poor in my opinion. But I'd like to see some more meat on the bone, in particular a demonstration of why this is easier/more powerful/more convenient to use than the alternatives.
replies(1): >>45084835 #
3. kyrra ◴[] No.45084327[source]
One example: Merge conflicts can be submitted as a proper entry and dealt with later: https://jj-vcs.github.io/jj/latest/conflicts/
4. senekor ◴[] No.45084439[source]
Hi, author here. Since the target audience is people with little to no Git experience, a detailed comparison would not make sense. I did simply make that claim because the weirdness of Git's UI is usually justified by saying how powerful it is. So this statement is just intended to ease the readers mind that they're not missing out on power by choosing a tool that's easier to learn.
replies(3): >>45084539 #>>45084685 #>>45087146 #
5. jennyholzer ◴[] No.45084539[source]
I appreciate this perspective.

IMO, the authors and evangelists of Git are essentially correct when they argue about its power.

However, I think that it's extremely difficult to gain practical experience with using Git in a high-powered, high-agency way, mostly because there are a lot of abstract concepts at play and there is no easily accessible place where these concepts can be "discovered".

Basically, Git is as good as it's cracked up to be, but only if you're an expert.

If you're interested in becoming a Git expert, I cannot recommend Emacs Magit strongly enough.

If not, I think Jujutsu could be an quicker road to a high-agency version control workflow. It's at least worth considering. I feel confident that Jujutsu can succeed, in particular because of Git's harsh difficulty curve.

replies(3): >>45084724 #>>45087011 #>>45088109 #
6. pkulak ◴[] No.45084678[source]
Say you start on Main, then make a new branch that you intend to be a PR someday. You make commit 1. Then another. Maybe 6 more. Now you realize that something in commit 1 should have been done differently. So, you "edit" commit 1. All the other commits automatically rebase on top and when you go back to your last commit, it's there. Same with _after_ you PR and someone notices something in commit 3. Edit it, push, and it's fixed.

You can do all that in Git, but I sure as hell never did; and my co-workers really appreciate PRs that are broken into lots of little commits that can be easily looked over, one by one.

replies(4): >>45084727 #>>45084733 #>>45084935 #>>45085106 #
7. marcuskaz ◴[] No.45084685[source]
I suppose I want the article written for the experienced developer, convince me why I should try something different than the huge defacto standard that is git. I'm totally open to trying something new, but need a compelling case.

Beyond `jj undo` everything else in this thread feels just as complicated as git.

replies(3): >>45084810 #>>45088010 #>>45089061 #
8. senekor ◴[] No.45084724{3}[source]
Thanks, but I consider myself a Git expert already :-) I read the Pro Git book cover to cover. I have a gluten-free, artisanal, free-range git config that I've grown and cared for over years. single character aliases all the important commands, "log all graph oneline", "commit amend no-edit", interactive rebase (ofc. with autosquash, autostash, updaterefs and rebasemerges), reset hard, push force-with-lease... Also: commit signing, url rewriting, conditional configs for different orgs, all that jazz. I was super productive with it and loved it.

And then Jujutsu came along and casually doubled my VCS productivity. I didn't see it coming!

replies(1): >>45085346 #
9. lrobinovitch ◴[] No.45084727[source]
You have to force push each time you do this, right? How do your coworkers find the incremental change you made to commit 1 after you force push it, and how do you deal with collaborative branches effectively this way? And if I don't want to work this way and force push, are there other benefits of jj?
replies(2): >>45084790 #>>45085517 #
10. adastra22 ◴[] No.45084733[source]
I do this every day in git. “git rebase -i [hash]” fyi.
replies(1): >>45084782 #
11. baq ◴[] No.45084782{3}[source]
you think you do, but you don't; jj edit is much, much better than an edit step in a rebase - it essentially keeps rebasing while you're editing, so you can always see which changes get conflicts, then you are free to resolve them, or not, at your convenience.
replies(3): >>45084799 #>>45086057 #>>45086723 #
12. baq ◴[] No.45084790{3}[source]
the heuristic is 'if you know about rerere and especially if you use it, you should try jj'. if you never force push, you might not see value in jj. (I basically always force push.)
replies(1): >>45084944 #
13. adastra22 ◴[] No.45084799{4}[source]
So you get all merge conflicts at once? How is that better?
replies(1): >>45084858 #
14. baq ◴[] No.45084810{3}[source]
do you know about git rerere? if yes, you might like jj.
replies(1): >>45089012 #
15. tcoff91 ◴[] No.45084835[source]
The main thing that makes it more powerful imo is that you can accomplish insane rebases with 1 command that would be really difficult with git.

Like let’s say you have 4 separate PRs in review that have no dependency on each other. You then work on new stuff on top of an octopus merge of all 4. You are exploring different approaches to a solution so you have several anonymous branches where you have tried different things. You want to rebase on master, so you just run jj rebase -d master. All 4 PR branches, the octopus merge, the anonymous branches, they all get rebased with that 1 command. If there are conflicts the first class conflicts mean that you can fix the conflicts whenever you want. If one of your experimental anonymous branches is in conflict but you are unlikely to go with that approach, just leave it in a conflicted state unless you change your mind that you want to actually go that direction.

16. baq ◴[] No.45084858{5}[source]
it's exponentially better because you don't need to resolve them until you're ready. conflicts are committed to the local repo like everything else, commits with conflicts are noisily warned about and you can fix them whenever instead of having no other option than immediately.
replies(2): >>45084917 #>>45085054 #
17. adastra22 ◴[] No.45084917{6}[source]
How does your repo work with conflicts? How does it compile?
replies(2): >>45085447 #>>45086310 #
18. philwelch ◴[] No.45084935[source]
I do that in Git all the time. JJ might be easier in some sense but “more powerful” implies that it can do things that are impossible in Git.
replies(3): >>45085525 #>>45085869 #>>45086493 #
19. lrobinovitch ◴[] No.45084944{4}[source]
That makes sense, good to know, thanks.

> I basically always force push

How do your colleagues deal with this, or is this mostly on experimental branches or individual projects?

replies(4): >>45085108 #>>45085122 #>>45085521 #>>45086437 #
20. ec109685 ◴[] No.45085054{6}[source]
To the sibling comment that is too deep to reply to, this covers why delayed conflict resolution is advantageous: https://news.ycombinator.com/item?id=45084835

It’s for other branches that hang off the commit that introduced the conflicts.

21. ileonichwiesz ◴[] No.45085106[source]
Okay, sure, but if I realize I should’ve done something differently in commit 1, why wouldn’t I just make a new commit with the fix?
replies(3): >>45085225 #>>45085789 #>>45087384 #
22. whateveracct ◴[] No.45085108{5}[source]
People barely ever work off my branches.
23. smw ◴[] No.45085122{5}[source]
It's generally fine if you force push a branch that you're the only one working on. In many projects, there's an expectation that the 'PR Branch' you create in order to make a github pull request is owned by you, and can be rebased/edited/force-pushed at will. It's very common to do things like `git commit --amend --no-edit` to fix a typo or lint issue and then force push to update the last commit.

This has it's problems, and there's a reason things like Geritt are popular in some more sophisticated shops, as they make it much easier to review changes to PRs in response to reviews, as an example.

24. tomstuart ◴[] No.45085225{3}[source]
Do you want another person (or yourself in the future) to be able to read your commits, in order, to get a clear account of what changed & why? If so, you should fix up those commits to address mistakes. If not, it doesn’t matter.
replies(3): >>45085388 #>>45085450 #>>45090987 #
25. nocman ◴[] No.45085346{4}[source]
Is there a particular pain point (or set of pain points) that you have using git which is removed when you use Jujutsu?

I am interested to know, because there seem to be a small number of people who really seem to like it, and up to this point I haven't been able to understand what it is that they are all so excited about.

replies(4): >>45085518 #>>45085779 #>>45087984 #>>45091664 #
26. KallDrexx ◴[] No.45085388{4}[source]
Not the OP but for me, no I don't actually.

In a PR branch, my branches usually have a bunch of WIP commits, especially if I've worked on a PR across day boundaries. It's common for more complex PRs that I started down one path and then changed to another path, in which case a lot of work that went into earlier commits is no longer relevant to the picture as a whole.

Once a PR has been submitted for review, I NEVER want to change previous commits and force push, because that breaks common tooling that other team mates rely on to see what changes since their last review. When you do a force push, they now have to review the full PR because they can't be guaranteed exactly which lines changed, and your commit message for the old pr is now muddled.

Once the PR has been merged, I prefer it merged as a single squashed commit so it's reflective of the single atomic PR (because most of the intermediary commits have never actually mattered to debugging a bug caused by a PR).

And if I've already merged a commit to main, then I 100% don't want to rewrite the history of that other commit.

So personally I have never found the commit history of a PR branch useful enough that rewriting past commits was beneficial. The commit history of main is immensely useful, enough that you never want to rewrite that either.

replies(3): >>45088997 #>>45089139 #>>45108989 #
27. baq ◴[] No.45085447{7}[source]
The edited commit, assuming it doesn’t have conflicts with predecessors, builds just fine. Successor commits with conflicts that you just introduced predictably don’t - but you aren’t editing them, so it isn’t a problem. In fact, that’s exactly why this feature is so compelling.
replies(1): >>45088030 #
28. christophilus ◴[] No.45085450{4}[source]
It’s useful for me to see the mistake and the fix, as it is a good way to jog my memory about the “why” of things. Pristine commit history is not important to me.
29. Disposal8433 ◴[] No.45085517{3}[source]
IIRC it's push force with lease, ie non destructive push force. No one will be bothered or notice what you did.

And if you have conflicts, it's really easy to rebase and fix any issue.

30. nchmy ◴[] No.45085518{5}[source]
for me, everything git is a pain point. But its not so much painpoints that it addresses, as it is that it just makes entirely new things dead-simple to do, especially via jjui.

"megamerges" are one such example. ive shared many links, here and in other posts

replies(1): >>45086891 #
31. baq ◴[] No.45085521{5}[source]
The PRs are either small enough that it isn’t a problem or large enough that it isn’t a problem… the odd in-between PR experience sucks and it’s one of the cases when I sometimes add more commits instead of force pushing.

+1 to sibling gerrit recommendation; I used to use it a decade ago and it was better then than GitHub PRs today.

32. Vinnl ◴[] No.45085525{3}[source]
I think generally when people say that for jj, they mean it can do the same things with fewer concepts.
replies(1): >>45085860 #
33. BeetleB ◴[] No.45085779{5}[source]
I would think the obvious answer is how jj deals with merge conflicts.

In git, if you get a conflict, you feel like you have to resolve it now.

With jj, most of the times I get merge conflicts, I simply ignore them and deal with them later. A conflict is not at all a blocker.

replies(2): >>45086184 #>>45086767 #
34. paradox460 ◴[] No.45085789{3}[source]
You can actually do that in JJ too. And you can take a change that's full of changes to other files, run a single command, and have those changes automatically put into the most recent change (save the one you're working on) that modified it recently.
35. sswatson ◴[] No.45085860{4}[source]
The author lists that as a separate benefit, though.

My interpretation is that jj makes certain useful operations convenient to use that would be so complex in git as to be completely impractical. Something like jj undo would be a simple example: jj users can do it, and git users can’t, even though it’s logically possible in both systems.

36. sunshowers ◴[] No.45085869{3}[source]
If you're in the middle of a git rebase -i of a stack of 20 commits, and realize while editing commit 15 that you made a mistake at commit 8, how do you go back and edit commit 8 without having to complete the rebase -i?

This is not contrived — this is an entirely realistic scenario that I use jj to handle all the time.

replies(1): >>45086836 #
37. 8n4vidtmkvmk ◴[] No.45086057{4}[source]
Jj edit isn't even the jj way of doing things. Should be jj new. Unless you have changes stacked after then you'd do jj new -A. And squish when you're done
replies(1): >>45086389 #
38. touristtam ◴[] No.45086184{6}[source]
> With jj, most of the times I get merge conflicts, I simply ignore them and deal with them later.

Sorry? You what? How do you know which bit from which source goes where?

replies(1): >>45086227 #
39. BeetleB ◴[] No.45086227{7}[source]
Here's a typical scenario.

You do a git pull, just so your branch isn't so out of sync. Immediately you get merge conflicts. You then tell jj "Hey, I'll deal with this later", and make a branch off of the last commit that was conflict free and continue your work there. jj stores the conflict as is, but your branch is conflict free.

When you feel you have the energy to deal with the conflict, you switch to the branch that has the conflict, and fix the issue(s). Then you can manipulate the graph (rebase, whatever) so you can have everything in one branch - your changes and the changes you pulled in.

replies(3): >>45086667 #>>45087058 #>>45091805 #
40. aseipp ◴[] No.45086310{7}[source]
You have this commit graph

    B --> X --> Y (main) --> Z --> @
     \
      --> G --> H
B is a base; yesterday the name "main" pointed to it, and today "main" points to Y. Z is a commit you wrote that you haven't published yet. "@" means "Working copy", which is a way of saying "what your filesystem looks like." So, at this time, you see the changes from B, X, Y, Z, but not G or H.

You want to rebase G --> H from B to Y. But unfortunately, G conflicts with X. H does not conflict with anything. When you run this rebase in Git, you will actually have to immediately fix the conflict between G and X in order for the rebase to continue. If you do not solve it right then, the entire rebase fails. Git's rebase is actually an algorithm represented by a state machine; you must solve the conflict to proceed from "conflicted state" and `git rebase --continue` the rebase algorithm. (If you imagine what you would need to do to actually implement 'git rebase' as it works today in your own code, this state machine model makes immediate sense.)

In Jujutsu, rebase is a non-stop operation and it always succeeds. There is no state machine. It will update the commit graph to look like this:

    B --> X --> Y (main) --> Z --> @
                 \
                   --> G --> H
                       C     C
Now G and H are marked as "conflicted". If any commit is marked as conflicted, then all (transitive) children are marked as conflicted, too. If you "switch over" to working on G, then you can solve the conflict and commit the solution. That will solve the conflict in G, and also H as well.

But you don't have to do anything. In the above graph, G and H are conflicted, but because they are not a parent of `@`, then it does not matter. They exist in a parallel universe that does not influence your own. You can keep compiling code as usual. If you "switched over" to G, then the conflict is "materialized" in your working copy (filesystem) by putting conflict markers in the files, and so you have to solve it to keep compiling.

In short, Jujutsu separates conflict computation (do patches X,Y have a conflict?) from conflict materialization (make the conflict appear with markers in a file), and materialization of conflicts is "lazy" -- it only happens if a conflict exists transitively in the history of your working copy. Resolution is then done at your leisure.

A more brainiac way of thinking about it is that Jujutsu is a tool for manipulating _commit graphs_, and that is a purely computational notion; adding edges, removing edges, etc are all just basic algorithms. The graph's nodes contain "content" and states like "conflicts" are just defined as a relationship C(X,Y) on nodes in the graph. But all of this is "purely computational." Imagine implementing Jujutsu's rebase command; it is just a trivial reparenting of some graph nodes, something an amateur programmer could do. Calculating the relationship `C` is a bit more involved, but not complete black magic. But none of this involves "reading files from disk" or whatever. The side effect of "update the files on your filesystem to look like state XYZ in the graph" is just that: a side effect that the tool does when it is needed. Git, in contrast, only works through "side effects" in that it tends to only operate on the working copy, and never the "holistic commit graph". And so Jujutsu works at a higher, more "pure" level.

-----

Fun fact: in some cases, you do not actually have to "switch over" to G in order to solve this conflict, either. It is actually possible to craft a "solution" to the conflict in G while on top of Z. Then you can do `jj squash --from @ --into G` and you can "teleport" the resolution into the conflicted commit, solving both G and H, without ever making it appear in the working copy. This happens in cases like "G modified a file named readme.txt that was deleted by commit X"; all you have to do is "re-delete" the file inside commit G and it is trivially solved. This is something that is, quite literally, impossible to do in Git.

replies(2): >>45086806 #>>45089453 #
41. BeetleB ◴[] No.45086389{5}[source]
As a relatively new jj user, I'm curious. Why is the jj new -A + squash better than just a jj edit?
replies(3): >>45086416 #>>45087841 #>>45089421 #
42. baq ◴[] No.45086416{6}[source]
Separation of concerns and performance; when you edit, the commit in the middle of the branch is your working copy and you’ll update the whole branch unnecessarily many times vs just once when you’re on a logical checkpoint.
replies(1): >>45088090 #
43. andrewaylett ◴[] No.45086437{5}[source]
JJ has the concept of "immutable changesets" -- if it sees a commit is referenced from a branch that it's not tracking, it assumes it ought not rebase that commit. Changesets on branches that look like the main branch are immutable too. And you can edit the revset that JJ considers immutable if you need it to be different from the default.

The net effect is that I can change "my" branches as I wish, but I can't change stuff that's been merged or other folks' branches unless I disable the safety features (either using `--ignore-immutable` or tracking the branch).

JJ also makes it really easy to push a single changeset as a branch, which means as you evolve that single commit you can keep the remote updated with your current work really easily. And it's got a specific `jj evolog` command to see how a specific changeset has evolved over time.

44. andrewaylett ◴[] No.45086493{3}[source]
JJ has first-class support for conflicted trees, changesets, branches, and operations. The op log itself is a (really useful) feature not present in Git.

You can always end up with the same set of published commits, guaranteed. But the tools you have for manufacturing them and for interacting with their history definitely include things that are possible in JJ but not in Git.

45. 1718627440 ◴[] No.45086667{8}[source]
So you essentially do a fast-forward until the first commit with a merge commit and then take the previous one?

Sounds like something that could also become a flag for git merge.

replies(2): >>45087968 #>>45088746 #
46. 1718627440 ◴[] No.45086723{4}[source]
You can use all the git commands while doing a rebase.

When you want to work on an older commit for a longer time and don't want to stay in a rebase, you just check it out and work normally, when you are done and want to propagate your changes, then you do a single rebase.

replies(1): >>45086814 #
47. nocman ◴[] No.45086767{6}[source]
> In git, if you get a conflict, you feel like you have to resolve it now.

I guess I view that as a positive rather than a negative. I'm not saying that dealing with merge conflicts is a picnic -- it isn't. I just find it difficult to believe that ignoring them and resolving them later will improve the situation in the long run.

replies(4): >>45087538 #>>45087964 #>>45089871 #>>45090681 #
48. 1718627440 ◴[] No.45086806{8}[source]
Thanks, for the long explanation.

[G: original, G' with conflicts, G" resolved]

What value do you get from G' and H' existing with conflicts when you can't use the working tree until after you have resolved the conflicts?

So in Git it would be G -> G", but in JJ you can do G -> G' -> G". But G" in both cases only exist, until after you have put in the work of solving the conflict. And G' only ever exists without a usable working tree. So what do you get from having G' earlier, when you still have G" only after the same work?

replies(1): >>45088072 #
49. baq ◴[] No.45086814{5}[source]
I’m reminded of the Dropbox comment.

You can do anything with a Turing machine. That you can isn’t the point. The point is the tool does all the things you can automatically and correctly so you don’t have to. There’s no ’just do this or that during rebase, or outside of it’. There’s only ‘it rebased everything correctly without a single thought, nice’.

replies(1): >>45086981 #
50. 1718627440 ◴[] No.45086836{4}[source]
True nested rebase doesn't exist (yet) in Git. What I do is create another commit with the parent commit 8 with commit --fixup and then complete the rebase. The I can just autosquash it, without reediting anything.

You could also keep the rebased commits, abort the rebase, rebase the already rebased commits and then continue the first rebase.

replies(1): >>45086939 #
51. nocman ◴[] No.45086891{6}[source]
> for me, everything git is a pain point

Yeah, I was looking for something (or "things") specific. An "I hate everything about it" explanation doesn't really compel me to try out the alternative.

> "megamerges" are one such example. ive shared many links, here and in other posts

I read through one megamerge link you shared ( https://v5.chriskrycho.com/journal/jujutsu-megamerges-and-jj... ). So the argument seems to be (forgive me if I'm reading this wrong), if you have multiple versions of a single set of source files that all have differing changes, for you JuJutsu makes it easier (easier then git, that is) to merge them into the final commit you want to end up with. Is that correct?

Just trying to make sure I understand. Honestly, after reading that article I am still not feeling the need to try Jujustu out. I'm still open to being convinced, but have yet to see anything that makes me go "wow, I need to try that!".

replies(3): >>45087517 #>>45089162 #>>45097666 #
52. sunshowers ◴[] No.45086939{5}[source]
With jj, because it doesn't have modal states of any kind, you can just go back to commit 8, edit it, and everything dependent on it gets auto-rebased. You can also do jj squash --into for a workflow similar to fixup commits.

I would consider the first workflow to be impossible to do by most mere mortals in Git [1]. Meanwhile in jj it's downright trivial.

[1] There technically is a way to do this by setting a temporary branch, aborting the rebase, starting another rebase -i, carefully editing the interactive instructions, going to commit 8, editing that commit, then cherry-picking 9-15 from the temporary branch. But it's too hard to do in practice, and far too easy to get wrong.

replies(1): >>45087026 #
53. 1718627440 ◴[] No.45086981{6}[source]
SSH is definitely easier than Dropbox :-).

Yes, and my point is that having a rebase and edit everything isn't too different from first modifying everything and then doing an automatic rebase.

54. 1718627440 ◴[] No.45087026{6}[source]
> [1] There technically is a way to do this

That's what I've described?

> rebase -i, carefully editing the interactive instructions

You neither need to use interactive rebase nor carefully edit, since there is rebase --onto.

> But it's too hard to do in practice, and far too easy to get wrong.

I do this often it's not more complicated then any other rebase.

What is annoying in Git is rebaseing across multiple merges while forging committer and date information. Can JJ do that better?

replies(1): >>45087470 #
55. EMM_386 ◴[] No.45087058{8}[source]
> When you feel you have the energy to deal with the conflict

So you just kick the can down the road and end up with possibly an even more difficult conflict resolution?

replies(2): >>45087653 #>>45088598 #
56. j2kun ◴[] No.45087146[source]
> more powerful than git

> not missing out on power

Two very different claims, and it only makes me more skeptical.

57. devnullbrain ◴[] No.45087384{3}[source]
Some repos merge/pull changes by rebasing them on main and want eventual history not actual history.
58. sunshowers ◴[] No.45087470{7}[source]
Ah I misinterpreted what "keep the rebase commits" meant.

I'm glad you don't find it too difficult to do. It's a workflow that seemingly works well for you!

59. nchmy ◴[] No.45087517{7}[source]
"multiple versions" = feature branches, possibly all in progress, probably all related. In a couple seconds, you can create a merge on top of all of them to join up their combined functionality/changes, work on top of that ON ALL OF THEM AT ONCE, and then squash all the relevant changes into the respective PRs that others (who are just using git) can review and merge into main.

At this point A LOT has been written in this and other threads, as well as lots of essays and tutorials about how jj just completely transforms your workflow. If you're curious, you'll seek it out. If not, that's fine as well.

replies(1): >>45088708 #
60. hellcow ◴[] No.45087538{7}[source]
It's not about "ignoring" conflicts. In jj you're often working with stacked diffs, and merge conflicts can impact a dozen "branches" all at once. This is trivial to resolve in jj and a nightmare in git. It lets you work on them one piece at a time and upon resolving it, instantly see the conflicts fixed across all your branches at once.
61. BeetleB ◴[] No.45087653{9}[source]
> So you just kick the can down the road and end up with possibly an even more difficult conflict resolution?

That sentiment is true for pretty much anything in life one may decide to defer till later :-)

More concretely, it's often not hard to tell if deferring it will make it worse, or merely the same.

The whole point of version control is to give your mind some peace in not worrying about things ("Let's make this change and we can always revert if it doesn't work out"). Conflicts are no different. There's no fundamental reason a conflict needs to be treated like an emergency.

62. hdjrudni ◴[] No.45087841{6}[source]
I forget where I read it (maybe from Martin), but one reason I like to `jj new` before I start any work is just because it makes it easy to revert or abandon if I don't end up liking it. And also easy to diff. `jj new` is pretty much 'free' anyway, every time you make an edit you're creating new commits (not changes!) anyway.
replies(1): >>45088700 #
63. steveklabnik ◴[] No.45087964{7}[source]
It’s about giving you choice. If you want to then fix them immediately, you can. But you don’t have to if you don’t want to.

But really, it’s about something deeper: rebase is a first-class operation in memory, and not a serious of patch applications via the file system. They’re therefore lightning quick, and will always succeed, which is nice. If you get partway through resolving a conflict and want to change to something else for some reason, that’s possible and simple.

64. steveklabnik ◴[] No.45087968{9}[source]
Git won’t let the portion of the branch that’s still conflicted remain in conflict while you go and work on the other part.
replies(1): >>45090471 #
65. stavros ◴[] No.45087984{5}[source]
For me, it's two things:

1. I understood git better after ten minutes of jj than after fifteen years of git. Git just doesn't expose its underlying data model as well as jj does. I guess, if you already know git well, this isn't going to make a difference for you.

2. This question is a bit like asking what can I do with a calculator that I can't do with pen and paper? Technically, nothing, but everything will be so much easier that you'll be much more likely to use it. Even though I can, technically, stash my worktree and jump to another commit with git, it's so fiddly to unstash (especially with multiple stacked switches/stashes) that I just never did it.

With jj, I leave commits in the middle and jump to other commits (to fix a bug or make a small change I noticed I need while working on a larger change) all the time, because there's zero friction.

jj just removes all the friction that's prevalent in git. Things are easy in jj that in git are merely possible.

replies(2): >>45088720 #>>45089117 #
66. stavros ◴[] No.45088010{3}[source]
There isn't a single thing in jj that's as complicated as git. I could go on to list a few features, but it would sound underwhelming, because you could do all that in git.

It's kind of like asking "why would I buy a digital camera when my film camera does all the same things? I can already see what the photo will look like when I take it, and developing my own film isn't that much of a hassle", yet film cameras have gone the way of the dodo, except for the occasional nostalgic enthusiast.

replies(1): >>45089289 #
67. adastra22 ◴[] No.45088030{8}[source]
Sorry if I’m being dense, but I still don’t get how this is any different. If I interactive rebase and stop to edit a commit, isn’t that the same thing?
replies(1): >>45089153 #
68. adastra22 ◴[] No.45088072{9}[source]
To expand on this(since I asked the question), I see mostly downside as the branch with G is unusable until the conflicts are resolved. Being able to keep a merge halfway resolved is a nice CLI shortcut. There should be a stash command for this, and I expect there probably is, or it can be done with work trees.
replies(1): >>45092493 #
69. adastra22 ◴[] No.45088090{7}[source]
Not everyone works by “logical checkpoint” commit strategy. I myself want my tree clean and commits being atomic state transitions. Otherwise git bisect (which I rely on) would break.

A lot of the jj strategies in this thread are a bit more cowboy, and I’m surprised.

replies(1): >>45089163 #
70. johnisgood ◴[] No.45088109{3}[source]
> If you're interested in becoming a Git expert, I cannot recommend Emacs Magit strongly enough.

Yes, Emacs' Magit and Git Cola.

replies(1): >>45097101 #
71. interroboink ◴[] No.45088571[source]
Jujutsu has many Mercurial-style features, one of them being revsets[1] - a set-notation-style DSL for selecting changesets (eg: which ones to log, etc). I have never found anything as powerful as revsets in Git.[2]

[1] https://jj-vcs.github.io/jj/latest/revsets/

[2] https://stackoverflow.com/questions/22520751/what-is-the-git...

replies(2): >>45088581 #>>45089737 #
72. capitainenemo ◴[] No.45088581[source]
Yeah, I'm excited by the mercurial-style features as a mercurial user looking for something to transition to in a world where git has, sadly, become the standard. The revsets were definitely a joy to discover. The main thing I'm hoping they add is mercurial's diff format which, according to the jujutsu dev discussions, is considerably better than git's, and allows for cleaner "absorb" and, apparently, the clearness of mercurial's "hg fa --deleted".

And, well, it's silly, but I do like revnums. It's a compact way to compare changes over time, even if it's only useful for the local repo. Would be nice to have those too.

73. sunshowers ◴[] No.45088598{9}[source]
Or none at all, if you decide to abandon that work (as has happened to me a bunch).
74. BeetleB ◴[] No.45088700{7}[source]
Oh I'm good with jj new for any new thing I'm working on. But I was wondering why one would use jj new -A to fix a commit in the past vs jj edit,
replies(1): >>45088815 #
75. typpilol ◴[] No.45088708{8}[source]
What does the history look like then? Just a single merge from a ton of branches or?
replies(1): >>45089169 #
76. BeetleB ◴[] No.45088720{6}[source]
> With jj, I leave commits in the middle and jump to other commits (to fix a bug or make a small change I noticed I need while working on a larger change) all the time, because there's zero friction.

For git users who are wondering "What friction? I just git stash and jump to another branch":

In jj, you just jump without needing to type any command like git stash.

replies(1): >>45089997 #
77. riwsky ◴[] No.45088746{9}[source]
No. The GP making a commit off of the first non-conflict isn’t the essence of the feature he’s talking about, just an example of what he can do next.

He’d also be free to edit upstream to not commit, or split a change in two so that parts unrelated to the conflict are in their own change. The big idea is that he doesn’t need to blindly decide that before seeing what the conflict is.

78. kps ◴[] No.45088815{8}[source]
Mostly to keep the new changes isolated from the original commit until they're ready, I think. The only time I use `jj edit` is to resume a leaf I left in the middle of something (where I might have used `git stash pop` but without needing to stash).
79. tux3 ◴[] No.45088997{5}[source]
When you force push a PR, Gitlab shows the changes from the last push. So it also depends which forge you use. I could see that working less well on Github or simpler Git forges
replies(1): >>45092976 #
80. spooneybarger ◴[] No.45089012{4}[source]
This made me laugh. Thank you.
replies(1): >>45090168 #
81. Izkata ◴[] No.45089061{3}[source]
A couple of them seem more complicated, like the example further up on the page for postponing merge conflicts. In git I'd just abort the merge and do it later.

I also found the exchange about named branches funny, that ends with:

> Ok, you need to call `jj bookmark set -r@ XYX` (or `jj b s -r@ XYX`), so what?

Apparently this is excusable, but people like to complain about git's commands being too obtuse - as far as I understand the git version is "git checkout -b XYX", right? (Or I guess "git switch -c XYX" with the new commands)

replies(2): >>45089144 #>>45091961 #
82. KingMob ◴[] No.45089117{6}[source]
I've taken to summing it up as "jj makes everyone the git guru".
83. Izkata ◴[] No.45089139{5}[source]
> Once the PR has been merged, I prefer it merged as a single squashed commit so it's reflective of the single atomic PR (because most of the intermediary commits have never actually mattered to debugging a bug caused by a PR).

While working on a maintenance team, most of the projects we handled were on svn where we couldn't squash commits and it as been a huge help enough times that I've turned against blind squashing in general. For example once a bug was introduced during the end-of-work linting cleanup, and a couple times after a code review suggestion. They were in rarely-triggered edge cases (like it came up several years after the code was changed, or were only revealed after a change somewhere else exposed them), but because there was no squash happening afterwards it was easy to look at what should have been happening and quickly fix.

By all means manually squash commits together to clean stuff up, but please keep the types of work separate. Especially once a merge request is opened, changes made from comments on it should not be squashed into the original work.

replies(1): >>45093055 #
84. steveklabnik ◴[] No.45089144{4}[source]
That’s backwards, your git command is “move to this branch” and the jj command is “update where the branch points to,” so git reset —hard.
replies(2): >>45089262 #>>45091987 #
85. steveklabnik ◴[] No.45089153{9}[source]
You have to finish the rebase before git will let you move in to other work. jj will not. With git you can stop in the middle to make changes, but you must continue until the rebase is done.
replies(1): >>45089925 #
86. KingMob ◴[] No.45089162{7}[source]
> I'm still open to being convinced, but have yet to see anything that makes me go "wow, I need to try that!".

You might not find that feature, but I'd suggest giving it a go anyway. The list of jj technical superiorities is short, but the numerous quality-of-life DX improvements all add up to pleasant, fearless version control.

Even without editor support or a UI, I abandoned git forever last year after using jj for a couple weeks.

Just my $.02.

replies(1): >>45091651 #
87. steveklabnik ◴[] No.45089163{8}[source]
The key is to be cowboy until you’re happy with things, and then get clean, just like with git. It’s way easier to slice and dice commits with jj and so you can be sloppy at first and it’s easy to turn beautiful afterward.
replies(1): >>45089939 #
88. KingMob ◴[] No.45089169{9}[source]
The parent is describing the megamerge pattern, which is a way to work on multiple branches at once.

You don't have to do that, and you rarely push it to others. History looks the same as git, usually, although I end up rebasing more than I ever did in git, since it's easier and safer.

89. Izkata ◴[] No.45089262{5}[source]
The git commands are "create new branch at HEAD and switch to it", and the context of the thread above sounded like that's the functionality they wanted?
replies(1): >>45089628 #
90. cortesoft ◴[] No.45089289{4}[source]
I don't think this is what the person you responded to is asking.

Their question is more, "why would I buy a digital camera that takes pictures in a new format that only a few cameras understand? All my tooling, 3rd parties, and other camera I own use the standard format. Even though I can see why the new format has advantages, I am still going to have to use the other format for all these other photos I have to work with, and there aren't equivalent tools in the new format for all these other photos things I need to do. Even if I buy this new camera, I am still going to have to work with the old format, so I'll have to learn how to use two formats now, and get used to two tool chains. Since the existing format is something I am going to have to use either way, how is it worth it for me to have to use two formats?"

replies(1): >>45090523 #
91. sfink ◴[] No.45089421{6}[source]
My personal opinion: `jj new` is better because it's non-modal. If you use `jj edit`, you're sort of switching to "edit mode": any change you make will trigger a rebase of all descendants.[1] You're live-mutating the core graph structure rather than a harmless appendage node. Also, if you notice something else that needs to be fixed, you can do it but then you'll need to remember to split it out into a separate commit before leaving edit mode.

With `jj new` + `jj squash`[2], you're collecting work that you can review as a separate thing anytime as you go along. You don't have to remember anything. If you throw in an unrelated change, you'll notice it if you review the changes before squashing them, so you can split it out then. And I'm pretty much always working in this state even when I'm at the top of my branch, so `jj new some-deep-node` doesn't really change anything. If I get called away and have no memory of what I was doing when I return, it doesn't matter: my jj state tells me exactly where things are and what I was doing.

[1] Which is not a huge problem, you have deferred conflict resolution so if something goes wrong you can probably just repair it with normal editing or your editor's undo functionality.

[2] I don't usually bother with `jj new -A`, since I'm going to squash my "out of line" temporary commit into the linear chain anyway. `jj new -A` is more similar to `jj edit` than `jj new` -- it shares some but not all of the modal disadvantages. So perhaps my answer to your actual question is: "yeah, I dunno either."

replies(1): >>45089922 #
92. codethief ◴[] No.45089453{8}[source]
I had been wondering for quite some time what people meant when they said "you can resolve conflicts later". Thanks so much for this excellent explanation!
93. steveklabnik ◴[] No.45089628{6}[source]
“jj bookmark set” doesn’t create a new branch and switch to it. It updates the head of an existing branch to a new place.

jj doesn’t have a “name a new branch and switch to it” command, because you usually don’t bother naming branches until you’re using them up to a forge, and there’s no “current branch” concept. I creat new named branches with “jj git push -c” which names it for me, and switching branches is closest to jj new or jj edit.

94. exclipy ◴[] No.45089737[source]
git-branchless implements revsets for git https://github.com/arxanas/git-branchless/wiki/Reference:-Re...
replies(1): >>45089907 #
95. raylu ◴[] No.45089871{7}[source]
the thing about rebasing/cherry-picking (including just popping the stash) in git is that you only have 2 choices: fix the conflict now or abandon the entire rebase/cherry-pick

with jj, you have the option to fix half of it and come back later. you can take a look and see how bad the conflicts are if you go a certain route and compare to another option

replies(1): >>45091729 #
96. MrJohz ◴[] No.45089907{3}[source]
Git branchless is basically jj as a git subcommand - it's no coincidence that arxanas is also involved in jj's development!
97. BeetleB ◴[] No.45089922{7}[source]
Indeed, that was my point. jj new -A would also trigger rebases.
replies(1): >>45107189 #
98. adastra22 ◴[] No.45089925{10}[source]
Ok. There are simple workarounds. I git rebase —quit and then make a branch for this saved rebase progress to return to later. I then restart the rebase from the corresponding commit. It would be much nicer if this was all wrapped up a simple command.

There is value here, but I think it is more like “add a new command consisting of 50-100 lines of code” not “write an entirely new VCS.”

replies(1): >>45090285 #
99. adastra22 ◴[] No.45089939{9}[source]
That’s not how I use git, at all. I have a messy workspace with a lot of things going on simultaneously, and only selectively stage when something crosses the finish line. Sounds very difficult to do this in jj.
replies(3): >>45090278 #>>45091465 #>>45095204 #
100. socalgal2 ◴[] No.45089997{7}[source]
git stash is not that simple. you'd need to remember what branch that stash applies to to get back to where you were.

I'm new to jj. I'm still mixed on if I like it not. I think it's mostly familiarity. For example, switching to a commit puts things in the state before the files were committed. All my projects have a presumit step that says "hey! commit your files!" so they are all incompatible with jj at the moment or at leas the default. I end up having to do temp stuff like `jj new` (ok, now they're committed). Now run my presubmit scripts. Then `jj undo` so I don't have this unneeded commit. That said, I'm sure there's a better way, I just haven't gotten used jj yet.

Others have said this, `jj undo` and `jj op restore` have been lifesavers though. No matter what I do I can get back to where I was before I messed up.

replies(3): >>45091695 #>>45091791 #>>45092309 #
101. baq ◴[] No.45090168{5}[source]
It’s funny because it’s true! ;)
102. steveklabnik ◴[] No.45090278{10}[source]
Selectively staging is easier in jj. I loved git’s index, jj does it better.
replies(1): >>45094652 #
103. steveklabnik ◴[] No.45090285{11}[source]
One little thing here, one little thing there, it all adds up. The jj model is more orthogonal, and so ends up being easier, which also translates to more power.
104. 1718627440 ◴[] No.45090471{10}[source]
I would just abort the conflict resolution.
replies(1): >>45096669 #
105. stavros ◴[] No.45090523{5}[source]
You don't have two formats, though. Jj transparently works with git. I use it for everything and none of my collaborators is even aware that I'm using jj.
replies(1): >>45092341 #
106. MrJohz ◴[] No.45090681{7}[source]
I think the word "later" is unhelpful in this situation because it implies all sorts of different timescales. You don't want to be resolving merge conflicts three weeks after you've created them, you're right!

Typically for me, "later" means "immediately after the rebase command has finished", which is very similar to git's "while the rebase command is running", but has some subtle and important differences.

For example, because the rebase completes first, I get to see roughly what the end-state of the rebase is before I start doing the hard work of fixing conflicts. This is useful as a sanity check - sometimes the reason I'm getting a bunch of merge conflicts is because I was rebasing the wrong things in the first place and included an extra commit somewhere. Seeing the result first gives me the chance to sanity check what I'm doing.

Another thing is that my repository is never in a broken state where I can't continue doing other things. There's no way in git to stash a rebase, say because I've realised a different approach might work better or just because I urgently need to work on something different. I either need to cancel the rebase and start it again later, or keep on going until it's over. In jj, because the conflicts are automatically checked in as part of the commits, I can easily jump backwards and forwards between the work I'm doing resolving my conflicts, and anything else.

Another way of thinking about it is that git is very modal. You check out a branch and are in the "branch" mode, and then you start a rebase and are in the "rebase" mode, and then you do a bisection and are in the "bisect" mode - it's difficult to move freely between these modes, and there's certain things you can only do in some modes and can't do in others. In contrast, jj has exactly one mode: "there is a commit checked out". The different operations like rebasing all happen atomically, so you never see the halfway state. But because things like conflicts can be encoded in the commit itself, you still have all the same power that the modal approach had, just with a simpler conceptual model.

107. thecupisblue ◴[] No.45090987{4}[source]
Yes, but in that case, I want the fix of the original mistake to be done in a new commit.

Why?

Example #1: - I am working on implementing API calls in the client, made 3 commits and opened a PR - In the meantime, the BE team decides they screwed up and need to update the spec

If I now go and fix it in the commit #1, I lose data. I both lose the version where the API call is in its original state, and I lose the data on what really happened, pretending everything is okay.

Example #2: - I am writing a JVM implementation for our smart-lens - In commit #2 I wrongly implement something, let's say garbage collection, and I release variables after they have 2 references due to a bug. - I am now 6 commits ahead and realise "oh shit wait I have a bug"

If I edit it inline in commit #2, I lose all the knowledge of what the bug was, what the fix is, what even happened or that there was a bug.

tldr: just do an interactive rebase

replies(1): >>45112884 #
108. sgjennings ◴[] No.45091465{10}[source]
You can work exactly this way using the “gitpatch” diff editor[1].

1. Your working copy contains whatever mish-mash of changes you want.

2. When you’re ready to stage and commit these changes, run `jj commit --tool gitpatch`

3. The iterative “stage this hunk?” UI from git lets you choose what to commit.

4. Your editor opens for a commit message.

5. The changes you selected are now in a new parent commit of your working copy, and the remaining changes are left in the working copy commit.

In addition to the _same_ workflow, jj makes it easier to have other workflows as well (you may be interested in the megamerge workflow if you’re always working on multiple tasks at once).

[1]: https://zerowidth.com/2025/jj-tips-and-tricks/#hunk-wise-sty...

109. nchmy ◴[] No.45091651{8}[source]
Jjui is an incredible TUI for jj. Its the only way I interact with jj
110. senekor ◴[] No.45091664{5}[source]
Yes and no.

Before I started using Jujutsu, I didn't have any pain points with using Git. I didn't understand what all the fuss was about. Git works well! So I totally understand how most Git users have that same reaction when hearing about Jujutsu.

I think the reason I even tried it out in the first place was because Steve Klabnik wrote a tutorial about it. I have a lot of respect for him, because the Rust book is really good. So I though: If Steve thinks it's worth it, I should probably check it out.

Now that I'm used to jj, going back reveals like 100 things that are immediately super annoying when using git. I don't feel like writing it all down TBH. :-) In a general sense, Jujutsu get's out of your way much better than Git. There are a lot of situations where Git blocks you from continuing to work. Have a merge conflict? Stop working, fix it right now. Want to check out another branch? Nu-uh, clean up your dirty worktree first. jj doesn't do that. Have a conflict? I'll record it in the commit, fix it whenever you like. Checking out another branch? No worries, I'll keep your work in progress safe in a commit.

111. skydhash ◴[] No.45091695{8}[source]
> git stash is not that simple. you'd need to remember what branch that stash applies to to get back to where you were.

I use the stash for changes I like or for small experiments, not tied to anything. For any other changes, I just create a wip commit and switch. It’s trivial to switch back and soft reset.

replies(1): >>45097251 #
112. skydhash ◴[] No.45091729{8}[source]
Are you using your editor or a special software/plugin for resolving conflicts. I used Sublime Merge in the patch, but now I’m using Magit+ediff. Resolving conflicts is quite trivial in that case. And I can always ‘rebase -i’ to revert some of the decisions I’ve taken.
113. MangoToupe ◴[] No.45091791{8}[source]
> git stash is not that simple.

It's a stack of diffs.

Anyway, I've probably used this to transfer changes between branches thousands of times. Once you grasp the underlying data model all these abstractions introduced by jujutsu seem more confusing.

That said, I do understand most people aren't going to take the day or so to read through any of the hundreds of detailed "explain the data model" articles online.

replies(2): >>45095062 #>>45095176 #
114. MangoToupe ◴[] No.45091805{8}[source]
Isn't this equivalent to simply hard resetting to before the pull? (Or the commit before the conflict?) Plus then you don't end up with an extraneous branch.
115. tsimionescu ◴[] No.45091961{4}[source]
> as far as I understand the git version is "git checkout -b XYX"

The difference is actually worse than that. There is not the regular git equivalent, because this step is just done implicitly for you, normally. That is, with jj, just because you had checked out the head of main and then you added a new commit, doesn't mean your new commit is now the new head of main. `jj bookmark set -r@ main` is the way you tell jj to actually advance main to your latest commit.

But you are right - `git switch -C main` would be more or less the equivalent in git if you were working in detached head mode, which is how jj normally works (note the `-C`, not `-c`, to forcefully update main to point to this commit).

116. tsimionescu ◴[] No.45091987{5}[source]
They're closer to the right command than you are. `git reset --hard` will move HEAD to the given branch. The right command would be `git checkout -B branch` / `git switch -C branch`, to create or update `branch` to point to the current commit (except for the side effect that future commits will then go onto `branch` in git, while they won't in jj).

Basically, jj is just like working with git in detached head mode as far as I can tell.

replies(1): >>45096660 #
117. arcbyte ◴[] No.45092309{8}[source]
> git stash is not that simple. you'd need to remember what branch that stash applies to to get back to where you were.

This quote confused me for a while. I was thinking "git stash isn't branch specific its just a single bucket". But I realoze you must be making lots of little changes that are highly branch specific and then not wanting to commit those, but instead stashing them. Which would leave you with a hellscape of stashes that can't just be unstashed.

The biggest problem with git is people just inventing asinine ways to do things and ending up with absolutely stupid problems like that. No sane person does these things but yet I do keep encountering people digging holes and falling in them. It's a bit like people who invent the clever idea of having one repository with multiple code bases on different root branches. It's possible but you dont deserve to be working in this industry if you think its a good idea.

Git is simple. It's stupid simple. That's its problem.

replies(1): >>45107021 #
118. mcepl ◴[] No.45092341{6}[source]
If you say that you can work only with JJ and never use git, you are delusional. For one, where is that JJ forge (i.e., the equivalent of Sourcehut)?
replies(2): >>45092523 #>>45093066 #
119. baq ◴[] No.45092493{10}[source]
The branch is indeed unusable, as opposed to the whole repository being unusable - it's a very nice upside actually.
replies(1): >>45097695 #
120. Macha ◴[] No.45092523{7}[source]
GitHub, or sourcehut, or whatever you prefer.

Maybe you feel that jj git fetch and jj git push are using "git" but it means you avoid the git cli in favour of the IMO better designed jj cli.

121. aniviacat ◴[] No.45092597[source]
It's also quickly followed by:

> Jujutsu is relatively new and doesn't cover 100% of the features of Git yet.

So it's more powerful except when it's not.

122. KallDrexx ◴[] No.45092976{6}[source]
Yeah I don't have much experience outside of GitHub for team projects, so maybe gitlab works better. For GitHub it just gives up and claims it can't give you diff since the last review
replies(1): >>45097268 #
123. KallDrexx ◴[] No.45093055{6}[source]
I wonder by your last comment if this is just is talking past each other.

I try very hard to keep my PRs very focused on one complete unit of work at a time. So when the squash happens that single commit represents one type of change being made to the system.

So when going through history to pinpoint the cause of the big, I can still get what logical change and unit of work caused the change. I don't see the intermediary commits of that unit of work, but I have not personally gotten value out of that level of granularity (especially on team projects where each person's commit practices are different).

If I start working on one PR that starts to contain a refactor or change imthat makes sense to isolate, I'll make that it's own pr that will be squashed.

124. stavros ◴[] No.45093066{7}[source]
I could respond to this uselessly pedantic comment, but then nobody wins.
replies(1): >>45093949 #
125. mamcx ◴[] No.45093098[source]
Other do a lot of nitpicking in workflows (with responses that are expected, like "but who cares" or "in git I could do the same"), but not answer this:

JJ is MORE powerful than git because has a BETTER SEMANTICS & ABSTRACTION.

That its. Is like when git emerge, it was more powerful than svn because was distributed.

I wanna make the point clear: Is NOT about the "amount of features or specific workflows" that with pain can be made on git and with effort could be retrofitted on jj eventually (if today are missed, like a equivalent of GitHub!).

The power is what abstraction made jj that is different to git: We work on "commits" all the time, and not need to manually sync the state. Everything derive from this.

And because is a better abstraction, it make more sense and is easier to understand.

The UX derive from this.

126. mcepl ◴[] No.45093949{8}[source]
I didn’t mean to be pedantic. My experience with Jujutsu was as bad as with Mercurial (and hg-git, I believe?) … after couple of hours working with my repo (https://git.sr.ht/~mcepl/m2crypto), looking at it with git, I got incomprehensible mess of destroyed multiple unmergeable heads (especially for Mercurial), and completely destroyed other branches, where I was not planning to work (Jujutsu). The only resolution in both case was export my work to plain patches, rm -r the checkout, clone again with git and forget anything about those other VCSes.

So, I claim that Jujutsu actually doesn’t work well with git repositories (and forges) very well, and I would like to see a native one.

replies(2): >>45094139 #>>45097232 #
127. stavros ◴[] No.45094139{9}[source]
It works fine for my use case, all my Github repos are in the state I'd expect, and I sometimes use git in my local repos as well, and that works fine. Hell, sometimes I use jj to fix a mess I made in git.

The only issue is being in detached HEAD all the time, but in practice it's not a big problem for me.

128. adastra22 ◴[] No.45094652{11}[source]
How? The jj documentation seems to be pretty clear about getting rid of the staging area.
replies(3): >>45094935 #>>45095953 #>>45096638 #
129. baq ◴[] No.45094935{12}[source]
staging isn't needed since everything including the working copy is a commit you can split, rebase, etc. without any checkin step. yes, it does make sense and yes, it works in practice - the uncommitted vs staged vs committed states are very git-specific and don't need to be special in any way. if you check in the wrong thing (note - your working copy is a commit, so by definition you can't not have wrong things checked in at times) you split it (stage and/or commit in git).
130. socalgal2 ◴[] No.45095062{9}[source]
Yes I know git stash is a stack of diffs. I’m responding to this

>> With jj, I leave commits in the middle and jump to other commits (to fix a bug or make a small change I noticed I need while working on a larger change) all the time, because there's zero friction.

> For git users who are wondering "What friction? I just git stash and jump to another branch"

git stash is not equivalent to jumping to another commit in jj

131. BeetleB ◴[] No.45095176{9}[source]
> Anyway, I've probably used this to transfer changes between branches thousands of times.

You could just use cherry pick.

replies(1): >>45095183 #
132. MangoToupe ◴[] No.45095183{10}[source]
That involves having to commit
133. BeetleB ◴[] No.45095204{10}[source]
> Sounds very difficult to do this in jj.

Pretty easy. While inaccurate, it's useful to think of jj as two separate repositories. One is the "clean" one that has everything nice and neat. The other is a repository of all your (very) incremental changes.

You have to actively decide what goes in the "clean" one. jj automatically puts stuff in the messy one. Any time you actively commit something, you're committing to the clean one. So you decide what goes in there.

When you do a push, only the "clean" commits are pushed.

134. Human-Cabbage ◴[] No.45095953{12}[source]
There are a couple main ways to achieve a workflow similar to Git's staging area.

#1: Squashing

Create a revision for the feature, then create another revision atop that.

  $ jj new main -m 'feature'
  $ jj new
  $ jj
  @  trtpzvno samfredrickson@gmail.com 2025-09-01 12:32:33 9ac76a0f
  │  (empty) (no description set)
  ○  wvzltyyr samfredrickson@gmail.com 2025-09-01 12:32:31 80b2d5d0
  │  (empty) feature
  ◆  zxrulorx samfredrickson@gmail.com 2024-12-11 03:44:38 main 351a2b30
  │  all the stuff
  $ vim
  $ jj
  @  trtpzvno samfredrickson@gmail.com 2025-09-01 12:34:50 5516c2b9
  │  (no description set)
  ○  wvzltyyr samfredrickson@gmail.com 2025-09-01 12:32:31 80b2d5d0
  │  (empty) feature
  ◆  zxrulorx samfredrickson@gmail.com 2024-12-11 03:44:38 main 351a2b30
  │  all the stuff
  ~
  $ jj squash -i
  # interactively choose hunks to squash into parent
  $ jj
  @  oxqnumku samfredrickson@gmail.com 2025-09-01 12:35:48 8694aa34
  │  (empty) (no description set)
  ○  wvzltyyr samfredrickson@gmail.com 2025-09-01 12:35:48 47110bff
  │  feature
  ◆  zxrulorx samfredrickson@gmail.com 2024-12-11 03:44:38 main 351a2b30
  │  all the stuff
  ~
#2: Splitting

Create a revision for the feature, then split it up retroactively.

  $ jj new main -m 'feature'
  $ jj
  @  snomlyny samfredrickson@gmail.com 2025-09-01 12:38:39 84c6ecaa
  │  (empty) feature
  ◆  zxrulorx samfredrickson@gmail.com 2024-12-11 03:44:38 main 351a2b30
  │  all the stuff
  ~
  $ vim
  $ jj
  @  snomlyny samfredrickson@gmail.com 2025-09-01 12:39:51 8038bdd4
  │  feature
  ◆  zxrulorx samfredrickson@gmail.com 2024-12-11 03:44:38 main 351a2b30
  │  all the stuff
  ~
  $ jj split
  # interactively choose hunks to keep, splitting the rest into a new revision
  $ jj
  @  zpnpvvzl samfredrickson@gmail.com 2025-09-01 12:41:47 5656f1c5
  │  debugging junk
  ○  snomlyny samfredrickson@gmail.com 2025-09-01 12:41:44 1d17740b
  │  feature
  ◆  zxrulorx samfredrickson@gmail.com 2024-12-11 03:44:38 main 351a2b30
  │  all the stuff
  ~
135. steveklabnik ◴[] No.45096638{12}[source]
Because it’s not a distinct feature, it’s just another commit. Which means you can bring all of the usual tools for modifying commits to bear. My sibling has some details, but at the high level, that’s the idea.
136. steveklabnik ◴[] No.45096660{6}[source]
You know, I was in the middle of some long flights and missed the -b! You’re right about that part, that’s my bad! I’m starting to forget git details at this point, haha. (I never used switch, always checkout -b)
137. steveklabnik ◴[] No.45096669{11}[source]
Then you’re back to the state before the rebase. Which is fine, the point is just that they’re not equivalent!
replies(1): >>45106167 #
138. mcepl ◴[] No.45097101{4}[source]
vim-fugitive
139. steveklabnik ◴[] No.45097232{9}[source]
I am very confused as to what happened to you here, that’s not usual.

Most of jj’s stuff is purely local. I woke on GitHub with jj just fine, the only thing people notice is that my autogenerated branch named are a bit odd.

140. steveklabnik ◴[] No.45097251{9}[source]
This is easy in jj too, I’ll often try something, jj new @- to try something else, and jj abandon whichever version I don’t end up using.

The nice thing is that all of this is part of the commit graph, not buried in stashes hidden from sight.

141. steveklabnik ◴[] No.45097268{7}[source]
GitHub is basically worst in class here, it’s true. Some forges are slightly better, others are way better. It’s so sad because I like GitHub overall but this is a huge weakness of it.
142. yencabulator ◴[] No.45097666{7}[source]
My read on jj so far has always been "convenience wrapper over a preexisting Git concept" and simultaneously "alternate CLI that might be easier to learn".

Much like BitKeeper was sort of like an automated set of conventions on top of SCCS, (and Git and BitKeeper are near-interchangeable if you don't look at any of the details,) jj is like an automated set of conventions on top of Git.

(I personally wish the jj project had leaned harder into "it's just Git operations, made easier" instead of the whole "abstraction over storage layers" spiel, which needlessly scares a person familiar with Git, and makes the project sound very wishy-washy. When you peek under the hood, it's just Git! If it wasn't, I probably wouldn't use it!)

143. yencabulator ◴[] No.45097695{11}[source]
Making a local worktree/shallow clone is dirt cheap, if you're worried about `git rebase` not storing its state in a restartable fashion.

jj's handling of merge conflicts is pretty much like in Git committing the conflict markers in git and editing the commit message to say "conflicting".

144. 1718627440 ◴[] No.45106167{12}[source]
Yes. What's the equivalent would be to just keep the successfully rebased part. Right now you need to do keep the ref yourself.

> Sounds like something that could also become a flag for git merge.

145. socalgal2 ◴[] No.45107021{9}[source]
> But I realoze you must be making lots of little changes that are highly branch specific and then not wanting to commit those, but instead stashing them

No, I'm specifically responding to the person above who claimed "git stash" is the same as switching to another commit in jj. It's not.

146. sfink ◴[] No.45107189{8}[source]
Heh, sorry. The `-A` part went whooshing over my head until I had already written up the rest. I just saw `jj new` and got triggered into a "well akshually..."
147. keybored ◴[] No.45108989{5}[source]
Most of the bad modern Git practices summed up in one comment (one atomic, squashed comment).
148. phatskat ◴[] No.45112884{5}[source]
From what I understand of how jj works, and I’m happy to be corrected because I’m still learning it, is that going back and editing those commits doesn’t change actual original “change” - that is, jj tracks a change ID to everything, and those original commits (once pushed) are immutable. So in theory, with jj, you should be able to see the original commit and the change to fix it, and you can still couple them into a single commit without losing that change history.