Skip to content

refactor(lib)!: lift stack graph algorithms onto StackMetadata - #65

Open
lettertwo wants to merge 2 commits into
mainfrom
stack-metadata-refactor
Open

refactor(lib)!: lift stack graph algorithms onto StackMetadata#65
lettertwo wants to merge 2 commits into
mainfrom
stack-metadata-refactor

Conversation

@lettertwo

@lettertwo lettertwo commented Aug 28, 2026

Copy link
Copy Markdown
Owner

This PR is the refactor that makes room for gh stack (github/gh-stack) as a second stack
provider alongside Graphite. No provider yet, and no CLI change.

git-workon-lib/src/stack/metadata.rs is new: a StackMetadata struct plus enumerate, current,
and changeset_walk. graphite.rs shrinks to read_metadata. Stack gains number: Option<u64>,
keyed by every member branch rather than by the stack root.

Only enumerate takes a &Repository, so only enumerate can prune ghost branches. current and
changeset_walk must not prune, since routing needs a deleted stack node visible to tell it from a
typo, and changeset assembly walks through a ghost to reach live descendants.

refactor(lib)! because the workon library surface moves.

Design notes in docs/adr/028-provider-neutral-stack-metadata.md, section 1.

Testing: zero test edits. The existing Graphite suites are the safety net. 585 tests, clippy clean.


Stack created with GitHub Stacks CLIGive Feedback 💬

@lettertwo lettertwo changed the title stack metadata refactor refactor(lib)!: lift stack graph algorithms onto StackMetadata Aug 28, 2026
@lettertwo lettertwo closed this Aug 28, 2026
@lettertwo lettertwo reopened this Aug 28, 2026
@lettertwo
lettertwo force-pushed the stack-metadata-refactor branch from dc5b4a5 to 220c65c Compare August 28, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant