Conversation
lettertwo
added this pull request to stack #103
September 16, 2026 14:36
lettertwo
force-pushed
the
stack-merged-marker
branch
from
September 16, 2026 14:53
b435983 to
aef42d6
Compare
lettertwo
force-pushed
the
stack-merged-marker
branch
from
September 16, 2026 15:45
aef42d6 to
dc7d3ad
Compare
lettertwo
force-pushed
the
stack-merged-marker
branch
from
September 16, 2026 17:01
dc7d3ad to
0e16948
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.
Background
gh stack syncnever removes a merged branch from the gh-stack metadata file. It setspullRequest.merged: trueon the row and keeps the row so its own rebase and display logic keep working, and its--prunerunsgit branch -Don the local branch. That delete fails when a worktree has the branch checked out, which is the normal git-workon case.The reader only carried
branchandbasefrom each row, soStackMetadatahad no notion of merged. The only filter inmetadata::enumerateis the ghost check, which never fires because the branch ref still exists. After a stack merges bottom-up,workon listandfindkeep showing the merged branch as an ordinary live stack member, with the rest of the stack still nested under it.Change
This PR reads
pullRequest.mergedintoBranchMetadata.mergedand carries the merged set onStackas a newmerged: HashSet<String>field. The field is a breaking addition to the publishedworkoncrate, on the same!precedent asnumber.enumeratedrops merged rows the way it drops ghosts, but first reparents each surviving branch past every merged ancestor. Sync merges a stack bottom-up, so without that step a merged bottom branch would take the whole remaining stack down with it.currentkeeps merged rows, since routing still needs them visible.display.rsdrops a merged branch that has no worktree and splices its live children onto its parent. A merged branch that does have a worktree still renders, with a dimmergedsuffix in the same slot and style as the#Nstack-number suffix.list --jsongains an additive per-stack"merged"array besideparentsandcheckouts.gh_stack_merged_branchso tests can write a mergedpullRequeston a gh-stack row.Graphite has no observable merged state in either
.graphite_metadata.dbor therefs/branch-metadata/*blobs, somergedis alwaysfalsethere. The gap is recorded in ADR-028 under Consequences.