Skip to content

fix: put branches whose parents form a loop on the default branch - #18

Merged
pablospe merged 1 commit into
mainfrom
fix/parent-cycle
Nov 15, 2026
Merged

pablospe merged 1 commit into
mainfrom
fix/parent-cycle

Conversation

@pablospe

Copy link
Copy Markdown
Owner

Two branches in diffnav, context-expand (1 commit) and icon-alingment-squash (21 commits), were missing from the tree entirely, so wt sync never rebased, pushed or pruned them, and said nothing about it.

Both start at the same old main commit, 91 commits back. Neither contains today's main, so there is no true ancestor and the diverged tier picks the closest candidate: for context-expand that's icon-alingment-squash (21 commits ahead of the shared base, against 91 for main), and for icon-alingment-squash it's context-expand (1 against 91). Each became the other's parent, the loop never reached main, and when children are wired up a node that isn't reachable from the root just isn't printed or visited.

After the tree is built, any branch whose parent chain doesn't reach the default branch now goes straight onto it, with a warning: every branch in a loop (none of them contains the others, so none is a better parent), and a branch whose parent isn't in the tree. In diffnav that gives main ├── context-expand ├── icon-alingment-squash └── osc1717 ..., which is what the history says. This doesn't change how parents are picked, so anything that wasn't looping keeps the same tree.

Unit test for the loop plus a branch hanging off it and an orphan; integration test in tests/stack_file.rs with two siblings off an old main.

@pablospe
pablospe merged commit 49f1287 into main Nov 15, 2026
2 checks passed
@pablospe
pablospe deleted the fix/parent-cycle branch November 15, 2026 19:41
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