Merge
A couple pages ago I teased you with a puzzle: you've mastered creating branches of empty commits; but how do you merge them?
Say you want to merge zx with o, and go from:
○ zx Click alternates Xs and Os main
○ v Click sets a X
○ s Square has state
│
│ ○ o Play instructions
│ ○ kx Play manual
├─╯
○ n Square is interactive
│
~
to:
@ vz Here's the merge
├─╮
│ ○ o Play instructions
│ ○ kx Play manual
○ │ zx Click alternates Xs and Os main
○ │ vv Click sets a X
○ │ s Square has state
├─╯
○ n Square is interactive
│
~
Hint
Hint
Remember, if you want to add a Change on top of X you run:
jj new -r X
The -r X part actually means:
Hey, Jujutsu! Create a new Change, having
Xas its parent.
Another hint
Another hint
Most of the commits have just 1 parent.
All merge commits have something special in common.
Solution
Solution
Sure, a merge commit is nothing but a new commit having 2 parents!
Therefore, to give the new Change 2 parents, simply pass both with -r. In this specific case:
jj new -r o -r zx -m "Here's the merge"
If you got it, kudos. That wasn't an easy one!