Skip to main content
← Back to all posts

Stacked changesets without branches: server-side restacking, instant reorders, and zero wasted CI

Break large features into small, reviewable changesets that stack natively on the server — with one-command reorders, guided bottom-up conflict resolution, automatic child promotion as layers land, and cryptographic check reuse so pure restacks never re-run passing CI.

  • changesets
  • feature
  • agents
6 min read

Large changes are hard to review, risky to land, and painful to untangle when a test breaks. Breaking a feature into a stack of small, dependent changes — schema first, backend logic second, CLI or UI third — fixes review size, and coding agents make stacking even more natural because an agent can draft three clean, focused layers in minutes.

The catch in traditional Git workflows is that stacks are simulated on top of mutable branches. Reordering two layers means interactive rebases and force-pushes across every branch above them. Merging the bottom pull request leaves child PRs pointing at a dead base or triggers a storm of redundant CI runs across code whose final tree did not change by a single byte.

Gitslice treats stacked changesets as a native server primitive — no branches to name, no force-pushes, one-command reorders, guided bottom-up conflict resolution, and automatic CI check reuse when bottom layers land.

Shell
gs create --all -m "Add billing schema"
gs create --all -m "Implement invoice service"
gs create --all -m "Expose billing CLI commands"

# Inspect checks, approvals, and links across the stack, then land in order
gs stack
gs submit

#1. Stacking without branches

In Gitslice, every workspace is bound to a slice rather than a local branch. When you run gs create while a draft changeset is active, the new changeset automatically stacks on top of the active changeset's current patchset:

flowchart LR
  M["main (trunk)"] --> C1["1. Billing schema (ps1)"]
  C1 --> C2["2. Invoice service (ps1)"]
  C2 --> C3["3. Billing CLI (ps1)"]

Each layer is its own changeset with its own review page, immutable patchset history, CI checks, and approvals. You never invent branch names like feat/billing-part-2-v3 or juggle git stash when switching layers:

Shell
gs stack                        # full stack overview: titles, check tallies, approvals, web URLs
gs down                         # switch workspace to the base changeset below
gs up                           # switch workspace to the dependent changeset above
gs bottom                       # jump to the root of the stack (gs top jumps to the tip)
gs switch <changeset>           # jump directly to any changeset in the stack
gs cs diff                      # show only this layer's diff against its parent changeset
gs diff --against <other-cs>    # compare overlapping paths against another open changeset

If you want to start an unrelated change in the same workspace without stacking on your current draft, pass gs create --root. To branch a parallel approach off the same parent layer, pass gs create --sibling. Both eager checkouts (gs init) and on-demand lazy workspaces (gs init --lazy) switch layers cleanly without re-cloning.

#2. Reorder, swap, and split in a single restack

Stack shapes rarely stay frozen after the first draft. Maybe a reviewer asks to land a refactor before the API change, or you realize a helper belongs in its own changeset underneath your active layer.

Gitslice restructures stacks on the server in one topological pass — updating all dependency links first and running a single restack from the lowest affected changeset upward, so intermediate states never mint throwaway patchsets or trigger duplicate CI runs:

Shell
# Swap the active changeset one step toward main or toward the tip
gs move --down
gs move --up

# Splice a changeset immediately below another changeset (even below the current root)
gs move 97048df407 --before 3a18c204ef

# Reorder an entire chain from base to top in one command
gs reorder 97048df407 3a18c204ef 8b4ee46085

# Split work by inserting a new changeset directly underneath the active layer
gs insert --base 3a18c204ef -m "Extract currency rounding helper"

# Split a dependent subtree out into its own independent stack
gs detach 8b4ee46085 -m "Follow-up CLI polish"

Whenever you edit an earlier layer in place with gs modify, Gitslice uploads the new patchset and automatically restacks every dependent changeset above it using three-way line merge and any folder merge rules in .gitslice/merge.yaml.

#3. Guided bottom-up conflict resolution

In a five-changeset stack, an overlapping edit in layer 1 used to mean watching conflict markers cascade noisily into layers 2, 3, 4, and 5 all at once.

Gitslice now stops restacking each branch at the first conflicted changeset from the bottom up, leaving higher layers untouched until their base is clean:

Shell
$ gs down && $EDITOR acme/billing/invoice.go
$ gs modify --all
updated 3a18c204ef patchset 2
updated dependents: cs_8b4ee46085...
conflicts: 8b4ee46085
  /acme/billing/invoice.go
Resolve conflicts in the file(s) above, then run gs restack --continue.

Your workspace automatically switches to the conflicted changeset and writes standard conflict markers into the affected files. Fix the file, save it, and continue:

Shell
$EDITOR acme/billing/invoice.go
gs restack --continue

gs restack --continue (also available as gs update-dependents --continue) verifies that no <<<<<<< / ======= / >>>>>>> markers remain, uploads the resolved patchset, and resumes restacking the remaining layers above it — either finishing with restack complete or stopping cleanly at the next conflict.

#4. Landing stacks with zero wasted CI

Two things make landing stacks painful in branch-based tools: orphaned child PRs when only part of a stack lands, and paying full CI runtime all over again for every child layer after its parent merges. Gitslice eliminates both:

  • Automatic child promotion on partial landings. When layer 1 lands (from the CLI, the web UI, or another workspace), open children automatically advance onto the landed commit. Running gs sync in your workspace moves you straight onto layer 2 at the new base — no manual detaching or branch surgery required.
  • One-command path submit. Running gs submit on layer 3 validates and lands layers 1, 2, and 3 in base-to-tip order. As each ancestor publishes, remaining layers automatically promote onto the new commit and continue landing without mid-stack stale-base errors.
  • Cryptographic CI check reuse. Every patchset records the cryptographic hash of the entire resulting repository tree. When layer 1 lands on refs/global/main and layer 2 restacks onto that commit without any other interleaved changes, layer 2's resulting tree is byte-for-byte identical to the tree CI already tested. Gitslice carries forward passing check results automatically and skips re-running CI — while never reusing failed or canceled runs so retries always execute fresh.
  • Live check progress & instant fast-fail. When checks do need to run, gs submit (and gs create --submit / gs modify --submit) streams check transitions, durations, and passed/total counts to stderr, aborts immediately if any required slice or .gitslice/checks.yaml check fails, and prints the failing run ID and last 30 log lines inline.

#5. How Gitslice compares to other stack tools

Stacked diffs pioneered at Google (Critique/Piper and Gerrit) and Meta (Phabricator and Sapling) have inspired an active ecosystem of tools for Git and GitHub. Each takes a distinct architectural trade-off:

Tool Where stacks live Reorder & restack What happens when layer 1 lands Scope & workspace model
GitHub (chained PRs) Chained Git branches on GitHub Manual branch rebases / UI update Retargets child PR branch; triggers full PR CI again Full Git repository
Graphite (gt) Local Git branches synced to GitHub PRs gt reorder / gt restack + force-push Stack-aware cloud merge queue or branch retarget + CI rerun Full Git repository
Jujutsu (jj) Local change-ID DAG (Git-backed) Automatic local descendant rebase; first-class conflicts Push updated branches to remote forge; forge re-runs CI Full local repository
Sapling (sl) Smartlog commit DAG Automatic local restack + sl pr submit --stack Syncs stacked PRs or lands via Meta-style review Sapling clone / sparse profiles
GitButler Virtual branches in one local working tree Drag-and-drop / CLI reorder in local client Pushes standard branches to GitHub/GitLab Full local Git clone
Gerrit Independent commits linked by Change-Id footer Local git rebase -i + git push HEAD:refs/for/main Server submission queue rebases series Full Git repository
Gitslice (gs) Server-native changeset graph on a single trunk Server-side gs reorder, gs move, gs restack --continue Auto-promotes children & reuses passing CI on identical trees Per-slice checkouts, lazy FUSE mounts, or zero-checkout MCP

If your team's source of truth is GitHub pull requests, Graphite, GitButler, Jujutsu, and chained GitHub PRs are great ways to tame multi-branch reviews on top of Git.

Gitslice builds stacking into the storage and CI model itself for teams and agent fleets working on a shared codebase:

  1. No branch explosion or force-push races. Stacks are first-class changesets targeting refs/global/main, with every revision preserved as an immutable patchset rather than overwritten by force-pushes.
  2. Server-side restacking plus per-path concurrency. Stacks compose naturally with --merge-on-submit and per-path admission, so dozens of agents and engineers can land independent stacks on the same slice without serializing behind one global merge queue.
  3. Tree-identical CI reuse. Landing a 4-changeset stack whose checks already passed does not burn 3x extra CI runner minutes re-testing identical trees as each bottom layer merges.
  4. Sized to the task, with Git at the boundary. Stack changes inside a focused slice or 2-second lazy mount, inspect everything with --json and gs schema, and still mirror every landed commit automatically to GitHub via Git Mirrors.

#6. Try it today

Stacked changesets are built into every Gitslice workspace — no plugins, branch naming conventions, or extra setup needed:

Shell
curl -fsSL https://gitslice.io/install.sh | sh
gs init <account>/<slice> work && cd work

# Create a stack of changesets, inspect it, and land it
gs create --all -m "Step 1: data model"
gs create --all -m "Step 2: service logic"
gs stack
gs submit

Read the Concepts guide, CI Checks docs, and CLI Reference for every command and flag, or send ideas and friction straight to us with gs feedback.