Skip to content

v0.2.28: ez create -m keeps parent fixed + full-subtree auto-restack fix#28

Merged
rohoswagger merged 2 commits into
mainfrom
feat/parent
Jun 23, 2026
Merged

v0.2.28: ez create -m keeps parent fixed + full-subtree auto-restack fix#28
rohoswagger merged 2 commits into
mainfrom
feat/parent

Conversation

@rohoswagger

Copy link
Copy Markdown
Owner

Summary

Two changes, released as v0.2.28.

1. `ez create -m` no longer advances the parent

Previously `ez create -m` committed on the current branch before forking, advancing the parent as a side effect. Now it stashes uncommitted state, creates the branch + worktree at the parent's unchanged tip, pops the stash into the new worktree, and commits there. `-m` with `--no-worktree` is rejected (the staged changes need somewhere to live).

2. Fix stale-`parent_head` auto-restack bug

`ez commit` / `ez amend` / `ez move` only restacked direct children (`state.children_of`). After a commit on a mid-stack branch, every descendant beyond the first level was left detached — `parent_head` still recorded the old parent tip and `ez log` rendered the stack as healthy, but a later mutation on the grandchild landed on the orphaned line and lost the parent's changes until a manual `ez restack`. This violated design principle #2 ("auto-restack on every mutation… users should never have to think about rebasing").

Fix: added `StackState::descendants_topo` (full transitive subtree, parents before children) and a shared `restack::cascade_restack` helper that walks it; routed commit/amend/move through it. Because each parent is restacked before its children, a single pass converges the whole subtree. This also de-duplicates four near-identical restack loops.

Tests

  • `descendants_topo_returns_whole_subtree_parents_before_children` (pure logic)
  • `cascade_restack_rebases_grandchildren_not_just_direct_children` (real-git: builds main→A→B→C, commits on A, asserts both B and C are restacked and A's change reaches C)
  • Plus 4 create-feature integration tests. Full suite: 226 passing, fmt + clippy clean.

🤖 Generated with Claude Code

rohoswagger and others added 2 commits June 23, 2026 15:49
…rent

Stash uncommitted state, create the branch+worktree at the parent's unchanged
tip, then pop the stash into the new worktree and commit there. Reject -m with
--no-worktree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ren (v0.2.28)

ez commit/amend/move only restacked direct children (state.children_of), so
after a commit on a mid-stack branch every descendant beyond the first level was
left detached — parent_head still recorded the old parent tip and ez log showed
the stack as healthy, but a later mutation on the grandchild lost the parent's
changes until a manual ez restack.

Add StackState::descendants_topo (full transitive subtree, parents before
children) and a shared restack::cascade_restack helper that walks it; route
commit, amend, and move through it. Because each parent is restacked before its
children, one pass converges the whole subtree.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rohoswagger rohoswagger merged commit c214ad7 into main Jun 23, 2026
4 checks passed
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