zlacker

[parent] [thread] 12 comments
1. dimitr+(OP)[view] [source] 2025-12-05 11:03:01
Jujutsu comes in handy here for the same usecase:

https://github.com/jj-vcs/jj

https://www.stavros.io/posts/switch-to-jujutsu-already-a-tut...

Also found https://github.com/gitbutlerapp/gitbutler

replies(2): >>ndr+11 >>crabmu+1c
2. ndr+11[view] [source] 2025-12-05 11:12:36
>>dimitr+(OP)
The main issue I kept having when trying to do this with just git is then managing all the branch names to be attached to the right moved commits, so that my stack could be reviewable on github's open PRs.

Does jj help with that at all?

I've experimented a bit with git-town.com (OSS) and now everyone at $DAYJOB uses graphite.com (SaaS) which does that part very well.

replies(2): >>baq+54 >>WorldM+S01
◧◩
3. baq+54[view] [source] [discussion] 2025-12-05 11:35:21
>>ndr+11
It’s one of the core features that rebases, including branch names (bookmarks in jj) work ‘correctly’. You can rebase whole dags, including merges, with multiple named heads with just one jj rebase -b.
replies(2): >>arccy+l9 >>gcr+0s
◧◩◪
4. arccy+l9[view] [source] [discussion] 2025-12-05 12:14:52
>>baq+54
note that bookmarks don't float, unlike git branches, so if your pattern is to produce a lot of commits, you'll want something to keep your jj bookmarks pointing to the top of your pile of commits.

this is less of a problem if you're more into the 1 change == 1 commit workflow.

replies(2): >>lima+A9 >>pimeys+P9
◧◩◪◨
5. lima+A9[view] [source] [discussion] 2025-12-05 12:16:49
>>arccy+l9
There's an experimental-advance-branches feature which helps with that!
◧◩◪◨
6. pimeys+P9[view] [source] [discussion] 2025-12-05 12:18:05
>>arccy+l9
There's a very common alias `jj tug` for this case:

  tug = ["bookmark", "move", "--from", "heads(::@- & bookmarks())", "--to", "@-"]
It moves the nearest bookmark to the commit before the current one (which should be your working commit).
replies(2): >>stavro+fe >>mhitza+kJ
7. crabmu+1c[view] [source] 2025-12-05 12:32:21
>>dimitr+(OP)
Half my team switched to JJ this year, and I do find stacking PRs to be much more pleasant now. We had previously tried out Graphite but it didn't really stick.

I wrote up a little way to use JJ's revsets to make it easy to push an entire stack of branches in one command:

https://crabmusket.net/2025/jj-bough-a-useful-alias-for-stac...

◧◩◪◨⬒
8. stavro+fe[view] [source] [discussion] 2025-12-05 12:47:48
>>pimeys+P9
Thanks, I replaced my Frankenstein's monster of a parsing pipeline with this, very useful!
◧◩◪
9. gcr+0s[view] [source] [discussion] 2025-12-05 14:03:21
>>baq+54
To expand: In jj, bookmarks point to "changes," not commits. Rebases, history manipulations, etc. preserve change ID, so this "just works."
◧◩◪◨⬒
10. mhitza+kJ[view] [source] [discussion] 2025-12-05 15:23:52
>>pimeys+P9
This looks like any other git arcane incantation. If this is a common pattern and jj aims to make things easier, should probably be part of the core commands, no?
replies(1): >>stevek+sf2
◧◩
11. WorldM+S01[view] [source] [discussion] 2025-12-05 16:32:16
>>ndr+11
`--update-refs` flag helps a lot in vanilla git. That and `--autosquash` should probably be default flags to `git rebase`. I also don't entirely trust rebase without `-i` (`--interactive`), personally. I hear there is talk about shaking up the out-of-the-box default flags in git 3, and I think rebase should especially get new defaults.
replies(1): >>171862+l82
◧◩◪
12. 171862+l82[view] [source] [discussion] 2025-12-05 21:53:08
>>WorldM+S01
I also use these flag when I have the need to, but I very much don't want them to become the default.
◧◩◪◨⬒⬓
13. stevek+sf2[view] [source] [discussion] 2025-12-05 22:37:51
>>mhitza+kJ
It's something that makes a specific workflow easier, a lot of folks that use jj don't necessarily use that workflow.

That doesn't mean it couldn't be a core command someday, but given that the alias works well for people, there's not a ton of reason to make a whole new command. You configure the alias and you're off to the races.

[go to top]