gh-stack icon indicating copy to clipboard operation
gh-stack copied to clipboard

gh stack sync --prune for a completed stack deletes the branch but leaves stack in gh stack checkout metadata

Open rwedoff opened this issue 5 months ago • 1 comments

gh stack sync --prune for a completed stack deletes the branch but leaves stack in gh stack checkout metadata.

Repro steps:

  1. Create a stack with 1 branch.
  2. Submit PR
  3. Complete PR
  4. Run gh stack sync --prune
  5. Branch is synced and deleted
  6. Run gh stack checkout
  7. Observe

Expected: Stack should be deleted Actual: Stack is not deleted, and cannot be selected because the branch no longer exists. Workaround: Create a branch with the same name as one that doesn't exist. Run gh stack untrack, delete branch.

rwedoff avatar Jun 17 '26 22:06 rwedoff

sync --help explicitly says pruning preserves stack metadata for rebase and display. The completed-stack picker is still unusable, but deleting metadata changes that contract. Should fully completed stacks be an exception, or should checkout omit them?

windsornguyen avatar Jul 12 '26 04:07 windsornguyen