SWITCHCASE STUDIOS
switchcasestudios.com
FIELD NOTES · SOFTWARE DELIVERY
● SwitchCase Studios — Engineering Workflow

Stack the Change,
Not the Risk

How GitHub stacked pull requests turn dependent work into focused reviews—without pretending smaller automatically means faster.

01

The Mega-PR Has a
Dependency Problem

A large pull request is rarely just a lot of code. It is usually several decisions arriving at the same checkpoint: a schema, a service boundary, an API, a user interface, tests, migration logic, and the compromises that connect them. The author sees one continuous story. The reviewer sees a wall of coupled uncertainty.

The familiar one-branch workflow offers two uncomfortable choices when those decisions depend on one another. Put the whole feature into one pull request and ask reviewers to hold the architecture in their heads at once. Or stop after each foundation, wait for it to merge, then begin the next layer. The first choice creates a review batch. The second creates an author queue.

That cost is not theoretical. Google’s 2018 study of modern code review combined 12 interviews, 44 survey responses, and logs for 9 million reviewed changes. It found code review was valued not only for catching problems, but also for maintaining standards, sharing knowledge, and improving design.[3] Microsoft researchers later analyzed roughly 1.5 million review comments across five projects and found that the proportion of feedback authors considered useful declined as the number of changed files rose.[4]

9M
reviewed changes analyzed in Google’s case study
Google Research · 2018
1.5M
review comments studied across five Microsoft projects
Bosu et al. · 2015
59%
mean review effectiveness for small changes in one experiment
Baum et al. · 2019
845K
GitHub PRs in a study finding size weakly tied to merge time
Kudrjavets et al. · 2022

A controlled experiment with 50 mostly professional developers gives the small-change argument sharper edges. Mean review effectiveness was 59% for the small change and 35% for larger changes; review efficiency was also higher for the smaller condition.[5] That result supports focused review, but it does not prove stacked pull requests cause better production outcomes. The study used seeded defects, one subject system, and controlled review tasks—not a live team using GitHub’s new stack workflow.

The counterevidence matters just as much. A 2022 study examined 845,316 GitHub pull requests across 100 repositories, then compared the pattern with more than 400,000 Gerrit and Phabricator reviews. It found only a weak relationship between change size and time to merge.[6] A smaller diff can reduce the surface of a decision. It cannot create reviewer capacity, clarify ownership, accelerate a slow build, or make an unstable design suddenly coherent.

A stack is not a speed hack. It is a way to make dependency visible and reviewable.

SWITCHCASE STUDIOS · OPERATING THESIS

Google’s engineering guidance describes the target more usefully than a line-count limit: one self-contained conceptual change, with related tests and enough context for a reviewer to understand its consequences. The same guidance explicitly recommends stacking dependent changes when waiting would block the author, while keeping every intermediate state healthy.[7] The unit to optimize is not “small.” It is coherent, testable, and safe to land.

The traditional PR is not the enemy

A small, independent, well-described pull request already has the shape reviewers need. Stacking is for a different problem: one larger outcome contains several coherent decisions that genuinely depend on one another.

02

What a Stack
Actually Changes

GitHub defines a stack as two or more pull requests in the same repository arranged in one linear dependency chain. The bottom pull request targets the trunk, usually main. Every pull request above it targets the branch directly below. Each reviewer sees only the diff for that layer, while the stack map preserves the larger sequence.[1]

01
Bottom · auth model → main

Establish the stable foundation

Schema, shared types, compatibility behavior, and tests land closest to trunk.

02
Middle · auth API → auth model

Add the dependent service boundary

The API pull request contains its own decision and shows only what changed above the model layer.

03
Top · auth UI → auth API

Connect the user-facing behavior

The interface can move forward while the foundational reviews remain open.

Merge · bottom up

Land approved layers in dependency order

GitHub can merge one layer, a contiguous portion, or the whole stack while preserving that order.

The important change is not the number of branches. It is that dependency moves from inside one large diff into the review model itself. A foundational correction belongs in the foundational branch. A UI comment belongs in the UI branch. Specialist reviewers can focus on the layers they understand best, and authors can keep building above work that has not merged yet.

GitHub’s native implementation, currently in public preview, goes beyond a manually chained set of ordinary pull requests. It treats the pull requests as a connected unit, displays their order, performs cascading rebases, and applies the trunk’s required reviews, CODEOWNERS, status checks, and relevant GitHub Actions workflows to every layer.[2] That closes several gaps that historically made stacks fragile: upper layers silently missing CI, branch bases drifting, and reviewers losing the map.

FOCUS

Narrower decisions

Each pull request owns one coherent concern, so feedback can be specific without scanning the whole feature repeatedly.

FLOW

Dependent work can continue

An author can begin the next layer while the foundation is still in review, instead of waiting or expanding one branch indefinitely.

ORDER

The graph becomes explicit

The stack shows what must land first and what each upper layer inherits, reducing dependency archaeology.

CONTROL

Trunk rules follow every layer

Required reviews, checks, code scanning, and ownership rules are evaluated against the base of the stack.

A stack is not five tiny projects. It is one dependency chain made reviewable.

SWITCHCASE STUDIOS · THE COHERENCE RULE

This model still demands architectural discipline. The lower a layer sits, the more upper work it can disturb. Stable contracts, additive migrations, compatibility boundaries, and feature flags belong low in the stack. Volatile presentation choices belong higher. If the foundation changes every afternoon, a tall stack simply gives instability more branches to travel through.

03

Smaller Is Not
Automatically Faster

The strongest case for stacked pull requests is not “more PRs equal more velocity.” It is that the workflow can preserve a small-batch review model even when the work is linearly dependent. DORA’s research treats small batches as a capability associated with software-delivery and organizational performance because they shorten feedback loops and make course correction less expensive.[9] That is evidence for a delivery principle, not proof that any particular stack tool improves outcomes.

Dimension Single traditional PR Stacked PRs
Review surface The complete feature or milestone. One coherent dependent layer at a time.
Dependency Often implicit inside one branch and diff. Explicit branch and pull-request chain.
Author progress Dependent work accumulates or waits. Work continues above an open lower layer.
Review flow One approval stream with full context. Focused layer reviews with a visible stack map.
Update cost One branch is updated. Lower-layer edits cascade through upper branches.
CI usage Usually one pull-request workflow set. Relevant workflows can run for every layer.
Merge model One change lands as one unit. Bottom-up, individually or in contiguous groups.
Best fit Small, independent, emergency, or generated changes. Large outcomes with coherent linear dependencies.

A second controlled experiment, involving 28 developers, illustrates why the distinction matters. Decomposing a change reduced false-positive review findings and changed how reviewers navigated for context. It did not increase detected defects, improve understanding of the rationale, or reduce review time.[8] Smaller units helped reviewers reason differently, but the organizational queue remained an organizational queue.

Where a stack earns its keep

  • Schema → service → API → interface work
  • Refactoring that prepares a focused behavior change
  • Large or AI-generated changes needing deliberate boundaries
  • Layers that benefit from different specialist reviewers
  • Work that stays buildable and safe after every merge

Where a normal PR stays cleaner

  • The change is already small and coherent
  • The work is independent rather than dependent
  • The architecture is changing too quickly to stabilize a base
  • The contribution comes from a fork
  • A narrow emergency fix needs the shortest safe path

The Metric Trap

One feature becoming four pull requests will make pull-request volume rise by definition. That is not productivity. Stack depth, lines changed, and PR count describe workflow shape. They do not tell leadership whether customers received value sooner or whether engineers spent the week resolving cascade conflicts.

Measure the feature across the whole chain: time to first meaningful review, active review time versus waiting time, review rounds, feature-level lead time, CI minutes, rebase conflicts, escaped defects, rollbacks, and reviewer confidence. The 2022 multi-platform study is a useful warning here: reducing change size alone did not meaningfully guarantee faster acceptance or merging.[6]

Small diffs reduce the surface of a decision

They do not create reviewer capacity, repair a slow build, clarify ownership, or stabilize a moving architecture. A stack improves the information structure around review; the team still has to improve the system around it.

04

Where Stacks
Topple

Every layer adds a review object, a branch, a CI execution surface, and a place for the local and remote graph to diverge. GitHub automates much of that coordination, but automation does not make the cost disappear. It changes the cost from manual branch surgery into a workflow the team can observe and govern.

FRAGMENT

Slicing by line count

Tiny fragments can remove the context required to judge behavior. Slice by concern, contract, or dependency—not an arbitrary diff target.

CASCADE

An unstable foundation

Feedback on a low layer rewrites every branch above it. Self-review the foundation and keep early stacks shallow.

MULTIPLY

CI on repeat

GitHub evaluates relevant workflows for each layer. Preserve correctness gates, then use stack metadata only to remove genuinely redundant jobs.

SERIALIZE

Unrelated work in one chain

Artificial dependencies create needless merge order and rebase overhead. Independent changes belong in independent pull requests.

GitHub’s current constraints are concrete. Native stacks require every branch to live in the same repository and follow one linear history; cross-fork stacks and GitHub Desktop are not supported. Every layer must satisfy the trunk’s protection rules before it can merge. Auto-merge is not supported, although merge queues are. The feature is still in public preview and subject to change.[2][11]

Failed path Early signal Course correction
Stack too deep One lower comment invalidates several upper reviews. Merge a stable portion, start a new stack, or fold layers.
Wrong-layer fixes Review diffs contain compensating code or duplicated changes. Commit on the owning branch, then cascade the rebase upward.
Unsafe intermediate state A lower PR passes tests but would break users if merged alone. Use additive migrations, compatibility seams, and feature flags.
Review notification flood Reviewers receive the entire stack before its foundation settles. Start bottom-up; parallelize only understandable specialist layers.
Integration mismatch Bots, dashboards, or ChatOps treat every layer as standalone. Audit stack metadata, webhooks, and merge APIs before rollout.
CI cost spike Feature-level Actions minutes grow faster than review quality. Keep required gates; de-duplicate expensive nonessential jobs.

Programmatic merging deserves special attention. GitHub’s rollout guidance says stacked merges require the asynchronous merge API; legacy pull-request merge endpoints cannot merge a stack. Organizations should update internal bots, dashboards, and ChatOps before expanding adoption.[12] A developer workflow is only healthy if the surrounding delivery system understands it.

When restacking becomes the work, the stack has stopped serving the work.

SWITCHCASE STUDIOS · EXIT SIGNAL

Course correction should be ordinary, not embarrassing. Fold two layers when the boundary was artificial. Split off independent work. Merge the stable bottom and start a fresh stack. Return to one PR when the change is already coherent. The goal is not to defend the stack. The goal is to preserve review quality while moving useful software toward production.

05

A Stack You Can
Actually Ship

GitHub now maintains an official gh stack extension. The public-preview quickstart currently requires GitHub CLI 2.90.0 or later and Git 2.20 or later. Because preview requirements can change, confirm the current quickstart before standardizing a team image or developer container.[10]

Install & authenticate
gh auth login
gh extension install github/gh-stack

Build From the Bottom Up

Create a three-layer stack
git switch main
git pull --ff-only

# Bottom: stable model and contract
gh stack init --base main feat/auth-model
# Implement, test, stage, and commit the model.

# Middle: dependent API
gh stack add feat/auth-api
# Implement, test, stage, and commit the API.

# Top: dependent interface
gh stack add feat/auth-ui
# Implement, test, stage, and commit the UI.

gh stack view
gh stack submit --open

gh stack submit pushes the branches, creates or updates their pull requests, assigns the correct bases, and links the native stack. In an interactive terminal it opens an editor for titles, descriptions, and draft state. For a non-interactive draft flow, use gh stack submit --auto; add --open when the generated pull requests are ready for review.[10]

Put Feedback in the Layer That Owns It

Correct a lower layer
gh stack checkout feat/auth-api
# Make the correction, test it, and commit it here.

gh stack rebase --upstack
gh stack push
gh stack top

The rebase command propagates the correction through every upper branch. The push command updates each active branch with explicit --force-with-lease protection. If conflicts occur, resolve and stage them, then run gh stack rebase --continue; use --abort to restore the pre-rebase state.[11]

Maintain, restructure & merge
gh stack view --short
gh stack sync
gh stack modify
gh stack merge
gh stack sync --prune

gh stack modify can fold, insert, reorder, rename, or drop layers, but it requires a clean working tree and linear history. gh stack merge merges an eligible bottom portion or the whole stack without bypassing protection rules. After merges, gh stack sync --prune fetches trunk, rebases remaining layers, pushes updates, syncs pull-request state, and removes merged local branches.[10]

Run a Real Pilot, Then Decide

01
Choose

Use one representative feature

Pick three or four genuinely dependent concerns—not a disposable demo and not the riskiest launch of the quarter.

02
Plan

Draw the merge-safe layers first

Put stable foundations low, dependent behavior high, and keep tests with the behavior they validate.

03
Review

Start bottom-up

Parallelize only when an upper layer is understandable and the right specialist can review it without guessing.

04
Measure

Retrospect at the feature level

Compare lead time, waiting time, rework, CI cost, conflict load, defects, and reviewer confidence with a similar normal-PR workflow.

GitHub recommends starting with a small group on real work, gathering feedback from both authors and reviewers, and auditing internal tooling before a broader rollout.[12] That is the right standard because direct empirical comparisons of GitHub’s new native stack workflow with ordinary GitHub pull requests remain limited. The supporting evidence is strongest for coherent decomposition and small-batch feedback; the platform feature is still new.

The decision rule

Use a stack when the next coherent change genuinely depends on work that should already be in review. Keep a normal pull request when the change is already small, independent, urgent, fork-based, or unable to stay safe layer by layer.

Make dependency visible. Keep every layer coherent. Measure the feature—not the ceremony.

Bibliography

  1. GitHub. About Stacked Pull Requests. 2026. Read the overview. Product documentation for a public-preview capability; behavior may change.
  2. GitHub. Stacked Pull Requests: Rules and Requirements. 2026. Read the reference. Covers same-repository limits, protections, Actions behavior, merge requirements, and linear history.
  3. Sadowski, C., Söderberg, E., Church, L., Sipko, M., & Bacchelli, A. Modern Code Review: A Case Study at Google. ICSE-SEIP, 2018. Read the study summary and paper. One-company case study using interviews, a survey, and review logs.
  4. Bosu, A., Greiler, M., & Bird, C. Characteristics of Useful Code Reviews: An Empirical Study at Microsoft. MSR, 2015. Read the paper. Historical, company-internal data; usefulness was modeled from author judgments.
  5. Baum, T., Schneider, K., & Bacchelli, A. Associating Working Memory Capacity and Code Change Ordering with Code Review Performance. Empirical Software Engineering 24, 2019. Read the peer-reviewed study. Controlled experiment with 50 mostly professional developers and seeded defects; not a field test of stacked PR tooling.
  6. Kudrjavets, G., Nagappan, N., & Rastogi, A. Do Small Code Changes Merge Faster? A Multi-Language Empirical Investigation. MSR, 2022. Read the peer-reviewed study. Analysis of 845,316 GitHub pull requests with replication across Gerrit and Phabricator.
  7. Google Engineering Practices. Small CLs. Read the practitioner guidance. “CL” means a self-contained change or pull request; guidance reflects Google’s operating practice rather than a controlled causal study.
  8. Di Biase, M., Bruntink, M., van Deursen, A., & Bacchelli, A. The Effects of Change Decomposition on Code Review—A Controlled Experiment. PeerJ Computer Science 5, 2019. Read the open-access study. Controlled experiment with 28 professional and graduate developers; limited sample and subject codebase.
  9. DORA. Working in Small Batches. Updated December 2025. Read the capability guide. Supports the broader delivery principle; it does not isolate stacked PR tooling as a causal factor.
  10. GitHub. Quickstart for Stacked Pull Requests and Stacked Pull Requests CLI Commands. 2026. Read the quickstart and command reference. Public-preview CLI details may change.
  11. GitHub. Managing and Merging Stacked Pull Requests. 2026. Read the management guide and merge guide.
  12. GitHub. Roll Out Stacked Pull Requests to Your Organization. 2026. Read the rollout guide. Includes pilot advice, CI implications, platform limits, and programmatic integration requirements.