Conversation
lettertwo
force-pushed
the
stack-model-mixed
branch
from
September 16, 2026 14:30
2571f71 to
ce83e33
Compare
lettertwo
added this pull request to stack #103
September 16, 2026 14:36
lettertwo
force-pushed
the
stack-model-mixed
branch
from
September 16, 2026 14:57
ce83e33 to
f532c07
Compare
lettertwo
force-pushed
the
stack-model-mixed
branch
from
September 16, 2026 15:33
f532c07 to
159a46a
Compare
lettertwo
force-pushed
the
stack-model-mixed
branch
2 times, most recently
from
September 16, 2026 15:47
a9ec8e8 to
bea298f
Compare
lettertwo
force-pushed
the
stack-model-mixed
branch
from
September 16, 2026 19:06
bea298f to
601fd91
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR lets one repository hold live Graphite and gh-stack branches at the same time.
workon.stackModel = autoused to resolve any repo with both tools' artifacts to Graphite, which silently hid every branch gh-stack tracked. Detection now tie-breaks on which provider has ref-backed tracked branches, and a newStackModel::Mixed { primary }reads both providers' metadata with per-branch fallback. gh-stack is the primary provider: GitHub's native stack support removed the reason to treat Graphite'sgt initas the more deliberate signal.Detection
With only one tool's artifacts present, nothing changes. With both present,
StackModel::detectreads each provider's liveness (graphite::has_live_branches/gh_stack::has_live_branches, which checkparentskeys againstresolve::branch_existsand never probe thegtbinary):Mixed { primary: GhStack }GraphiteGhStackGhStack(doctorexplains)The last row changes 0.13.x behavior, which resolved a doubly-stale repo to
Graphite; hence the!.An explicit
workon.stackModel = graphiteorgh-stackstays strict and never falls back. Two new values,mixed:gh-stackandmixed:graphite, pinMixedwith the named primary and skip the liveness read, so a repo that wants Graphite answering first can say so without losing gh-stack's branches. Baremixedis rejected. The rule and its rationale are in ADR-028, "Detection: live-metadata tie-break".Library
StackModel::providers()yields the providers to consult in fallback order.current_stackandassemble_changesetsreturn the first provider with a row for the head branch. A read error from either provider propagates rather than falling through, since a corrupt store is a failure and not an empty result.enumerate_stacksunderMixedreturns the primary's stacks followed by the secondary's, dropping any secondary stack that shares a branch with a primary one.display::build_treededupes byvisited, so without this a shared branch would land non-deterministically.provider_has_live_branchesis public so the CLI can ask the same liveness questiondetectdoes.CLI
newregisters a fork with whichever provider already tracks its base branch, checked inproviders()order. No base, or a base neither provider knows, falls to the primary. gh-stack's symlink plumbing still runs whenever gh-stack is one of the providers, regardless of which one owns the fork.doctor'sBothStackToolsDetectednow reports whatautoresolved to and each provider's liveness. A newStackModelPinHidesLiveBranchescheck fires when an explicit pin hides the other provider's live branches, and amixed:<provider>pin whose primary has no artifacts gets the same treatment asstackModel = graphitewithoutgt init.listprints a dimmed stderr hint under the same pin-hides-branches predicate.Mixeditself stays quiet, since both providers are already visible.Testing
Detection tests cover all four cells of the table plus ghost (unresolvable) branches on each side. Config tests cover the two
mixed:values and the rejected forms. CLI tests cover fork registration following the parent's provider underMixed(and falling to gh-stack when no provider knows the base), thedoctorliveness report and pin checks, and thelisthint. The recipe in docs/recipes/stacked-diffs.md describes the user-facing behavior.