zlacker

[parent] [thread] 12 comments
1. stevek+(OP)[view] [source] 2025-12-06 00:12:11
submodules aren't native with jj, you use git commands to manage them, and it works fine. Eventually there'll be some sort of native support.

worktrees are called "workspaces" in jj, but are the same.

A lot of people find jj easier to have good commit hygiene with, and find it simpler and more powerful, not less. But that said, if you're happy with git, you should continue to use it.

replies(1): >>wakawa+Mf
2. wakawa+Mf[view] [source] 2025-12-06 02:42:54
>>stevek+(OP)
What is the most useful feature of jj that you think git doesn't have?
replies(2): >>martin+ys >>stevek+tL1
◧◩
3. martin+ys[view] [source] [discussion] 2025-12-06 05:06:22
>>wakawa+Mf
I can pick only one? Perhaps automatic rebasing then, i.e. that all descendant commits and bookmarks (branches) are automatically updated when you rewrite a commit, e.g. by amending into it.
replies(1): >>wakawa+yz
◧◩◪
4. wakawa+yz[view] [source] [discussion] 2025-12-06 07:01:58
>>martin+ys
I don't think I would want to rewrite all branches based on rewriting one of the ancestors of those branches. This only makes sense for local branches, and I just never have such a set of branches. Most rebases are to get ahead of upstream work, and I can't rewrite that. The rest are to rewrite commits that I made, and I collapse all those commits down periodically anyway. In the rare case I might be able to use this feature, rebasing all the other branches (realistically, probably like 1 or 2) would be easy enough to do manually with the feature described in this post. Rebasing and touching up commits is very easy with git interactive rebase. There are also features to automatically reorder commits with, e. g., `git commit --fixup` and `git rebase --autosquash`.

If you have others in mind then go ahead lol. I was just trying to make it easy.

replies(1): >>martin+HA
◧◩◪◨
5. martin+HA[view] [source] [discussion] 2025-12-06 07:20:55
>>wakawa+yz
> I don't think I would want to rewrite all branches based on rewriting one of the ancestors of those branches. This only makes sense for local branches, and I just never have such a set of branches.

Yes, it's only meant for local branches. When I used Git, I had a script for rebasing dependent branches. I remember that a coworker had written a similar script.

I think jj is generally more useful for people like me who often have lots of independent and dependent work in progress. If you mostly just have a one review at a time, there's much less benefit. Perhaps I would say that `jj undo` might be the most useful feature for users with simpler development (yes, I know about the reflog, but see the video I linked to in the other message).

replies(2): >>wakawa+l81 >>171862+mw1
◧◩◪◨⬒
6. wakawa+l81[view] [source] [discussion] 2025-12-06 14:08:04
>>martin+HA
I think you're right about people having trouble with `git reset` but it's really not that hard. There is also the newer `git restore` command which is somewhat easier. There are many individual functions which have an inverse, so the word "undo" might not be a good choice for git. You could make a `git undo` that does the `jj undo` logic with the reflog very easily. I'm not sold on the simplifications yet but to be fair I'm not trying to learn it either lol.
◧◩◪◨⬒
7. 171862+mw1[view] [source] [discussion] 2025-12-06 17:25:37
>>martin+HA
I think this is generally only useful, if these branches don't need any other change for updating the ancestor. When they need than you need to work on the branch anyway and rebase other commits or add new ones on top, so you gain nothing compared to "rebase --onto" for each branch separately.

If you don't have anything to update then that would be somewhat pointless to me. You can also just rebase them, when you start working on the branch again or want to merge them.

--

For me branches also represent features, that should have clear boundaries, so when I work on one feature and that means, I need to rebase another one on top instead of being able to just merge them later, this indicates a spaghetti codebase where the interfaces between features are not properly defined and things depend on internals of other things.

replies(2): >>martin+az1 >>wakawa+T22
◧◩◪◨⬒⬓
8. martin+az1[view] [source] [discussion] 2025-12-06 17:45:59
>>171862+mw1
Let's say you have this (modified from `git rebase --help`):

``` A---B---C main \ D---E---F feature1 \ \---G---H feature2 \ \---I---J feature3 ```

(sorry about the formatting here. I guess you'll have to copy & paste it to read it)

What I'm saying is that if I want to fix something in D, I do `jj new D` to create a new commit on top of D. Then I make the fix, run tests, etc., and then I run `jj squash` to amend the changes into D. The descendant commits (E through J) then get automatically rebased and the feature bookmarks/branches get updated.

I didn't follow what you about it other changes needed for updating the ancestor. Can you explain in the context of this example?

replies(2): >>171862+QB1 >>stevek+CL1
◧◩◪◨⬒⬓⬔
9. 171862+QB1[view] [source] [discussion] 2025-12-06 18:11:57
>>martin+az1
So what I am saying is that after you created D', it is true, that you need to run `rebase --onto` in git, while it is automatic in jj. But I think updating feature2 and feature3 is only really necessary to do now, when you want to change something in G-J also. If you don't and it wouldn't cause merge conflicts at all (logical and physical) then you could also just do this when you work on top of H or J the next time, so it wouldn't actually cause any more work in git compared to JJ.

--

The other thing I am saying is that I don't really let features depend on each other, I let them specify the API between them first and then develop them independently. Otherwise it is easy to violate boundaries. So the ideal is that any of G,H and I,J works with D,E,F and vice versa. Of course that is tangential and it doesn't always work that way.

◧◩
10. stevek+tL1[view] [source] [discussion] 2025-12-06 19:23:05
>>wakawa+Mf
For me, that's probably jj undo, just because it makes everything else so nice to just give a try. I really don't worry about making mistakes.

But for me, it's not so much features that git doesn't have, it's that the core is factored in a way that's more focused and orthogonal. The stuff that I used to like to do with git is even easier and more straightforward with jj. This is more of the result of a bunch of different design decisions and how they fit together rather than just some specific feature that's great.

◧◩◪◨⬒⬓⬔
11. stevek+CL1[view] [source] [discussion] 2025-12-06 19:24:42
>>martin+az1
Hacker News doesn't support Markdown, but you can indent lines by two spaces to get it formatted like code: https://news.ycombinator.com/formatdoc
◧◩◪◨⬒⬓
12. wakawa+T22[view] [source] [discussion] 2025-12-06 22:05:26
>>171862+mw1
>For me branches also represent features, that should have clear boundaries

I try to do this too but I often end up in situations where I have multiple incomplete (in testing, not merged) features with outstanding patches. Instead of one branch per topic, I end up with one branch for a bunch of related stuff. I then rebase and pause at the feature boundaries to do more testing. Sometimes, if I find myself doing this a lot, I will use the `exec` feature of `git rebase` to automate my testing.

I think rewriting all related branches can cause problems. It would be really weird to do interactively for one thing. The other problem is that you may have unrelated topic branches broken by such a change. If you have a broken patch X that reveals problem Y on branch Z1, but you are working on fixing that on Z2, you may lose your ability to reproduce the Z1 issue if X is fixed on every branch. What if you get conflicts on all those branches? What does this do to the reflog? Yikes! It seems more dangerous than git itself.

These complaints are very niche of course, but the problem of rewriting many branches at once is also very niche. It can cause more problems than it solves.

replies(1): >>stevek+p62
◧◩◪◨⬒⬓⬔
13. stevek+p62[view] [source] [discussion] 2025-12-06 22:35:05
>>wakawa+T22
jj doesn't force you to resolve the conflicts immediately, so it'll just show that they're conflicted until you decide you want to go fix them.
[go to top]