@@ -49,94 +49,71 @@ jip s --upstream upstream
4949
5050---
5151
52- ## Multi-stack workflow: reformat, bugfix, feature, and docs
52+ ## Multi-stack workflow: user feature and docs
5353
54- You need to make four changes to a project. Three are related (reformat →
55- bugfix → feature ), one is unrelated (docs). You decide to split them into two
56- stacks.
54+ You need to make four changes to a project. Three are related (data model →
55+ store → API endpoint ), one is unrelated (docs). You decide to split them into
56+ two stacks.
5757
5858### Setting up the stacks
5959
6060``` bash
61- # Stack 1: reformat → bugfix → feature
61+ # Stack 1: data model → store → API endpoint
6262jj new main
63- # ... run gofumpt, verify ...
64- jj commit -m " style: reformat all Go files with gofumpt "
63+ # ... create user type ...
64+ jj commit -m " feat: add user data model "
6565
66- # ... fix the bug ...
67- jj commit -m " fix: correct off-by-one in pagination "
66+ # ... create store ...
67+ jj commit -m " feat: add user store "
6868
69- # ... implement feature ...
70- jj commit -m " feat: add cursor-based pagination "
69+ # ... create handler ...
70+ jj commit -m " feat: add user API endpoint "
7171
7272# Stack 2: unrelated docs change (branching from main, not from the stack above)
7373jj new main
7474# ... update docs ...
75- jj commit -m " docs: update API examples for v2 "
75+ jj commit -m " docs: update README with getting started section "
7676```
7777
78- Your jj log now looks like :
78+ Your jj log now shows two independent stacks branching from main :
7979
80- ```
81- @ yyozkxuu alice@example.com 2026-02-26 21:18:04 beb5c864
82- │ (empty) (no description set)
83- ○ vuzkwnuw alice@example.com 2026-02-26 21:18:04 9df5376f
84- │ docs: update API examples for v2
85- │ ○ prmxnnou alice@example.com 2026-02-26 21:18:04 06d70097
86- │ │ feat: add cursor-based pagination
87- │ ○ plxqtqrq alice@example.com 2026-02-26 21:18:04 5ec21ca9
88- │ │ fix: correct off-by-one in pagination
89- │ ○ tolsvlnw alice@example.com 2026-02-26 21:18:04 0268aba3
90- ├─╯ style: reformat all Go files with gofumpt
91- ○ tznkmxxk alice@example.com 2026-02-26 21:17:54 main 62073074
92- │ initial commit
93- ◆ zzzzzzzz root() 00000000
94- ```
80+ ![ jj log showing two independent stacks branching from main] ( images/multi-stack-jj-log.png )
9581
9682### Sending both stacks
9783
9884``` bash
9985# Send both stacks at once (tips of each stack, jip resolves ancestors)
100- jip s prm vu
86+ jip s qnv ppx
10187```
10288
10389jip creates 4 PRs total: 3 for stack 1 (each building on the previous), 1 for
10490the docs change.
10591
10692### Review feedback comes in
10793
108- The reviewer approves the reformat PR and merges it. They request changes to
109- the bugfix and want a small tweak to the feature .
94+ The reviewer requests changes to the user store ( PR # 2 ) — they want a ` List `
95+ method added .
11096
11197``` bash
112- # Fix the bugfix commit
113- jj new plx
114- # ... make changes ...
115- jj squash
116-
117- # Fix the feature commit
118- jj new prm
119- # ... make changes ...
98+ # Fix the user store commit
99+ jj new pkn
100+ # ... add List method ...
120101jj squash
121102
122- # Fetch the merged reformat PR and rebase
123- jj git fetch
124- jj rebase -o main
125-
126103# Update all PRs (jip posts comments showing what changed)
127- jip s prm vu
104+ jip s qnv ppx
128105
129106# Or combine rebase + send in one step
130- jip s --rebase prm vu
107+ jip s --rebase qnv ppx
131108```
132109
133- The reformat PR is already merged, so jip skips it . The bugfix PR now targets
134- ` main ` directly (since its parent was merged) . The feature PR is rebased on
135- top . Reviewers see comments showing exactly what changed.
110+ The user store PR ( # 2 ) gets a comment showing the added ` List ` method . The API
111+ endpoint PR ( # 3 ) is rebased but its content didn't change . The data model PR
112+ ( # 1 ) is unaffected . Reviewers see comments showing exactly what changed.
136113
137114### Continuing the cycle
138115
139- The reviewer approves and merges the bugfix PR :
116+ The reviewer approves and merges the data model PR ( # 1 ) :
140117
141118``` bash
142119jj git fetch
@@ -148,8 +125,8 @@ jip s -x main::
148125jip s -x --rebase main::
149126```
150127
151- Now only the feature PR remains, targeting ` main ` directly. The stack
152- shortened itself one PR at a time.
128+ Now the user store PR targets ` main ` directly. The stack shortened itself one
129+ PR at a time.
153130
154131Meanwhile the docs PR was reviewed and merged independently — it was never
155132part of the same stack.
@@ -193,6 +170,10 @@ jj squash
193170jip s
194171```
195172
173+ jip posts a comment on the updated PR showing exactly what changed:
174+
175+ ![ Interdiff comment showing exactly what changed since the last push] ( images/interdiff-comment.png )
176+
196177### How do I add a new commit to an existing stack?
197178
198179Use ` jj new ` to insert a commit at the right position:
@@ -226,3 +207,5 @@ on GitHub. The remaining commit's PR is updated normally.
226207
227208Yes. If your revset resolves to a single commit, jip creates a single PR with
228209no stack navigation in the description.
210+
211+ ![ A single-commit PR with no stack navigation] ( images/independent-pr.png )
0 commit comments