Repository navigation
Delivery and Stacks
Each Feature delivers through one linear stack of Trace PRs. The delivery key in Configuration sets where the stack merges.
Trace PRs merge into the feature branch. The feature PR then merges into main and closes the Feature.
gitGraph
commit id: "main"
branch feature/5
branch trace/10
commit id: "#10 Skeleton"
branch trace/11
commit id: "#11"
branch trace/12
commit id: "#12"
branch trace/13
commit id: "#13"
checkout feature/5
merge trace/10 id: "merge #10"
merge trace/11 id: "merge #11"
merge trace/12 id: "merge #12"
merge trace/13 id: "merge #13"
checkout main
merge feature/5 id: "feature PR"
Each Trace PR merges into main. The last Trace PR closes the Feature.
gitGraph
commit id: "main"
branch trace/10
commit id: "#10 Skeleton"
branch trace/11
commit id: "#11"
branch trace/12
commit id: "#12"
branch trace/13
commit id: "#13"
checkout main
merge trace/10 id: "merge #10"
merge trace/11 id: "merge #11"
merge trace/12 id: "merge #12"
merge trace/13 id: "merge #13"
The stack tip is the head branch of the highest open Trace PR of the Feature. If the Feature has no open Trace PR, the tip is the feature branch (staged) or main (trunk).
- A Trace starts its branch from the stack tip. It never waits for a merge.
- Before WTF opens the PR, it rebases the branch onto the current tip when necessary. Then it runs the tests and pushes the branch.
- The PR targets the tip. Then
wtf.create-prlinks the PR into the native GitHub stack. - A Trace is ready to start when each Trace that it builds on is in the stack or merged.
- Merge bottom-up, with a merge commit. Never squash a Trace PR.
- Each merge deletes the head branch. Then GitHub retargets the next PR in the stack. For this,
wtf.setupenables Automatically delete head branches. - If the repo has no required reviews,
wtf.loopmerges each PR when CI is green. If the repo has required reviews, the open PRs wait for a reviewer as one stack. - To merge more than one layer at a time, run
gh stack merge <pr-number>. Select the merge-commit method.
wtf.setup installs github/gh-stack. WTF links the open Trace PRs into a stack with gh stack link <bottom-pr> ... <top-pr>. GitHub then shows the stack map on each PR, and each PR shows only its own diff.
If the extension is not installed, the PRs stack by base branch only. Then wtf.create-pr adds a "stacked PR" note to the PR body.
A native stack locks the base branches:
-
gh pr edit --baseon a stacked PR fails with the errorpart of a stack. To change the base, rungh stack unstack <stack-number>first. Then change the base, and link the PRs withgh stack link. -
gh stack viewshows only the local tracking. To see the stack on GitHub, look at the stack map on a PR page.
The source of these pages is docs/wiki/ in the repo. Edit the pages there. A workflow overwrites each change that you make in the wiki.
Start
Concepts
Workflow
Reference