Refactor stack management into forest command group with conflict-preserving rebase #634
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.

This branch consolidates stack operations (split, merge, reroot) under a unified forest command group. Replaces separate consolidate/split commands with forest subcommands that provide better UX and enable conflict-preserving rebase workflows.
Files Changed
Added (14 files)
src/erk/cli/commands/forest/- Forest command group (list, show, rename, split, merge, reroot operations)src/erk/core/forest_ops.py- Core forest operations (forest membership logic, tree queries)src/erk/core/forest_types.py- Forest dataclasses (ForestMetadata, Forest, ForestWorkTree)src/erk/core/forest_utils.py- Forest utilities (membership calculation, worktree grouping)tests/commands/forest/- Forest command tests (split, merge, reroot workflows)tests/core/test_forest_*.py- Forest operations teststests/fakes/forest_ops.py- Fake forest operations for testingDeleted (4 files)
src/erk/cli/commands/consolidate.py- Replaced by forest merge commandsrc/erk/cli/commands/split/- Replaced by forest split commandtests/cli/commands/split/- Test consolidationModified (31 files)
Key Changes
[CONFLICT]commit markersCritical Notes