{"slug": "stacked-changesets-without-branches-server-side-restacking-and-ci-check-reuse", "title": "Stacked changesets without branches: server-side restacking and CI check reuse", "summary": "Gitslice introduced stacked changesets as a native server primitive that lets developers break large features into small dependent changesets without naming branches or force-pushing, with one-command reorders, guided bottom-up conflict resolution, automatic child promotion as layers land, and cryptographic CI check reuse so pure restacks never re-run passing checks. Running `gs create` while a draft changeset is active automatically stacks the new changeset on the active changeset's current patchset, and `gs create --root` or `gs create --sibling` start unrelated or parallel changes. Editing an earlier layer with `gs modify` uploads a new patchset and restacks every dependent changeset above it using three-way line merge and folder merge rules in `.gitslice/merge.yaml`, while `gs restack --continue` verifies no conflict markers remain before resuming restacking of higher layers.", "body_md": "# Stacked changesets without branches: server-side restacking, instant reorders, and zero wasted CI\n\nBreak 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.\n\n- changesets\n- feature\n- agents\n\nLarge 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.\n\nThe 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.\n\nGitslice 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.\n\n## [#](#stacking-without-branches)1. Stacking without branches\n\nIn Gitslice, every workspace is bound to a [slice](https://gitslice.io/doc/concepts) 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:\n\n``` php\nflowchart LR\n  M[\"main (trunk)\"] --> C1[\"1. Billing schema (ps1)\"]\n  C1 --> C2[\"2. Invoice service (ps1)\"]\n  C2 --> C3[\"3. Billing CLI (ps1)\"]\n```\n\nEach layer is its own changeset with its own review page, immutable patchset history, [CI checks](https://gitslice.io/doc/checks), and approvals. You never invent branch names like `feat/billing-part-2-v3` or juggle `git stash` when switching layers:\n\nIf 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](https://gitslice.io/doc/lazy) (` gs init --lazy`) switch layers cleanly without re-cloning.\n\n## [#](#reorder-swap-and-split-in-a-single-restack)2. Reorder, swap, and split in a single restack\n\nStack 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.\n\nGitslice 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:\n\nWhenever 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`.\n\n## [#](#guided-bottom-up-conflict-resolution)3. Guided bottom-up conflict resolution\n\nIn 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.\n\nGitslice now stops restacking each branch at the **first conflicted changeset** from the bottom up, leaving higher layers untouched until their base is clean:\n\nYour workspace automatically switches to the conflicted changeset and writes standard conflict markers into the affected files. Fix the file, save it, and continue:\n\n`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.\n\n## [#](#landing-stacks-with-zero-wasted-ci)4. Landing stacks with zero wasted CI\n\nTwo 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:\n\n- **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.\n- **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.\n- **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.\n- **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.\n\n## [#](#how-gitslice-compares-to-other-stack-tools)5. How Gitslice compares to other stack tools\n\nStacked 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:\n\n| Tool | Where stacks live | Reorder & restack | What happens when layer 1 lands | Scope & workspace model | \n|---|---|---|---|---|\n| **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 | \n| **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 | \n| **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 | \n| **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 | \n| **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 | \n| **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 | \n| **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](https://gitslice.io/doc/lazy) , or zero-checkout MCP | \n\nIf 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.\n\nGitslice builds stacking into the storage and CI model itself for teams and agent fleets working on a shared codebase:\n\n1. **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.\n2. **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.\n3. **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.\n4. **Sized to the task, with Git at the boundary.** Stack changes inside a focused[slice](https://gitslice.io/doc/concepts) or 2-second[lazy mount](https://gitslice.io/doc/lazy) , inspect everything with`--json` and`gs schema` , and still mirror every landed commit automatically to GitHub via[Git Mirrors](https://gitslice.io/doc/mirrors) .\n\n## [#](#try-it-today)6. Try it today\n\nStacked changesets are built into every Gitslice workspace — no plugins, branch naming conventions, or extra setup needed:\n\nRead the [Concepts guide](https://gitslice.io/doc/concepts), [CI Checks docs](https://gitslice.io/doc/checks), and [CLI Reference](https://gitslice.io/doc/cli) for every command and flag, or send ideas and friction straight to us with `gs feedback`.", "url": "https://wpnews.pro/news/stacked-changesets-without-branches-server-side-restacking-and-ci-check-reuse", "canonical_source": "https://gitslice.io/blogs/stacked-changesets", "published_at": "2026-11-30 00:46:28+00:00", "updated_at": "2026-11-30 01:16:16.642949+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["Gitslice", "gs create", "gs modify", "gs restack", "gs init"], "also_reported_by": [], "takeaway": "Gitslice stacks each new changeset on the active draft's current patchset via `gs create` and restacks dependents server-side in one topological pass after `gs modify`, so pure restacks reuse passing CI checks instead of re-running them.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/stacked-changesets-without-branches-server-side-restacking-and-ci-check-reuse", "markdown": "https://wpnews.pro/news/stacked-changesets-without-branches-server-side-restacking-and-ci-check-reuse.md", "text": "https://wpnews.pro/news/stacked-changesets-without-branches-server-side-restacking-and-ci-check-reuse.txt", "jsonld": "https://wpnews.pro/news/stacked-changesets-without-branches-server-side-restacking-and-ci-check-reuse.jsonld"}}