Repository navigation
fix: put branches whose parents form a loop on the default branch - #18
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two branches in diffnav,
context-expand(1 commit) andicon-alingment-squash(21 commits), were missing from the tree entirely, sowt syncnever rebased, pushed or pruned them, and said nothing about it.Both start at the same old
maincommit, 91 commits back. Neither contains today'smain, so there is no true ancestor and the diverged tier picks the closest candidate: forcontext-expandthat'sicon-alingment-squash(21 commits ahead of the shared base, against 91 formain), and foricon-alingment-squashit'scontext-expand(1 against 91). Each became the other's parent, the loop never reachedmain, 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.rswith two siblings off an old main.