Skip to main content

Module stack

Module stack 

Source
Expand description

Stack metadata: the branch.<name>.stkParent/stkBase annotations and the structural queries built on them. Navigation lives in [nav], the rebase engine in restack.

Functions§

abort_restack
adopt_branch
base_for_branch
behind_parent_hint
A restack nudge when branch is missing commits from its parent’s tip. Local-only; a missing parent yields nothing.
branch_and_descendants
branch_parents
(branch, parent) pairs for the branches that have a stack parent; branches without one are skipped.
checkout_bottom
Check out the bottom of the current stack: the branch just above the trunk. From the trunk itself, a single stacked child is unambiguous.
checkout_child
checkout_parent
checkout_top
Check out the leaf of the current stack, following single children. A fork is ambiguous, like up without a branch.
children_for_branch
continue_restack
create_branch
detach_branch
parent_for_branch
path_from_root
The stack path from the bottom up to (and including) branch, parent-first; descendants above it are left out.
print_children
print_parent
print_stack
record_base
Record the fork point between a branch and its parent (best effort; e.g. unrelated histories have no merge base, which is not an error here).
rename_branch
Rename a branch and keep the stack intact. Git moves the branch’s own metadata with the rename; children pointing at the old name are retargeted here.
restack
set_base_for_branch
set_parent_for_branch
stack_root
The root of the stack containing branch (the base everything sits on).
trunk_branch
The trunk branch: the remote’s default branch when known locally, otherwise a conventional name that exists.
unset_base_for_branch
unset_parent_for_branch