Stacked branches
A stack is a chain of branches, each built on the one below it, like main ← api ← ui ← docs. Each layer becomes its own small pull request.
Make a stack
Section titled “Make a stack”- From a branch’s menu, create a new layer on top of it. What you’ve staged is committed to the new layer.
- Or drop a branch onto another to stack it there.
- When you create a branch on another branch that isn’t the trunk, MyTwig suggests stacking it.
MyTwig keeps the parent of each branch in the repository’s Git config. It also recognizes stacks made by git-town, Graphite and git-spice, stacks of pull requests that target each other, and branches whose upstream is another local branch.
See the stack
Section titled “See the stack”The left panel’s Stacks section shows each stack, top layer first, with each layer’s pull request, review and CI, and whether it needs restacking, is merged, or would conflict. In the graph, a stack’s labels share a color and are joined by a line. A layer’s details show a map like main ← #12 ← #13 ← #14.
Keep it up to date
Section titled “Keep it up to date”- Restack puts each layer back on the tip of its parent after the parent changes. Merged layers are taken out. Committing to or amending a layer restacks the layers above it automatically.
- Sync Stack fetches, updates the trunk, removes layers merged upstream (squash merges too), restacks, pushes, and points each pull request at the layer below it. It then offers to delete merged branches.
If a layer would conflict, or its remote branch has someone else’s commits, MyTwig stops and tells you rather than overwrite anything. Undo puts everything back.
Submit the stack
Section titled “Submit the stack”Submit Stack… pushes every layer in one atomic push, each with a lease, then opens a pull request for each layer into the one below it (or retargets the existing one). Each pull request’s description gets a list of the whole stack, kept up to date between <!-- mytwig-stack --> markers. The rest of the description is yours.
Review someone else’s stack
Section titled “Review someone else’s stack”On a pull request that’s part of a stack, Check Out Stack fetches every layer and checks them out as local branches.
Compare with Pushed shows, commit by commit, how a layer differs from what you last pushed: the same, changed, dropped or new. That’s what your reviewers will see.