| ▲ | VonGallifrey 8 hours ago | |
Can you show how you would do this in jj? I know how I would do this in git, but don't really see how this would be in jj. I currently don't use it in my workflow, but if it is super easy in jj then I could see myself switching. | ||
| ▲ | bilkow 8 hours ago | parent | next [-] | |
This is how I'd do it:
This creates an empty commit that merges all 3 branches, you can think of this as your staging area.When you want to move specific changes to an existing commit, let's say a commit with an ID that starts with `zyx` (all jj commands highlights the starting characters that make the commit / change unambiguous):
Then select your changes in the TUI. `-i` stands for interactive.If you want to move changes to a new commit on one of the branches:
Then select the changes you want moved. `-A` is the same as `--insert-after`, it inserts the commit between that commit and any children (including the merge commit you're on).There's one thing that's a bit annoying, the commit is there but the head of the branch hasn't been moved, you have to move it manually (I used + to get the child to be clearer, but I usually just type the first characters of the new change id): | ||
| ▲ | baq 8 hours ago | parent | prev [-] | |
the beauty of it is there's not much to show; I use a crude jjui approach where I have an octopus merge working tree commit (in command line terms, jj new PR_A PR_B PR_C) and either use native jj absorb (S-A in jjui) which guesses where to squash based on the path or, when I'm feeling fancy, rebase the octopus via jjui set parents (S-M) function (also handy to clean up parents when one of the PRs gets merged). | ||