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
branchis 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
upwithout a branch. - children_
for_ branch - continue_
restack - create_
branch - detach_
branch - insert_
branch - Insert a new empty branch directly above the current one, moving the
current branch’s children onto it. The new branch shares the current tip,
so descendants stay correctly based; commit to it, then
restackto replay them. Any uncommitted changes ride onto the new branch, likenew. - 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. - prepend_
branch - Insert a new empty branch directly below the current one, moving the
current branch onto it. Branches from the current branch’s parent, so it
requires a clean worktree. Commit to it, then
restack. - print_
all_ stacks - Print every stack, not just the current one: the trunk-rooted forest with a single trunk line at the bottom, and each rootless fragment as its own tree above it. The branch you are on is marked wherever it appears.
- 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 - snapshot
- Record the current stack so
undocan restore it. Thelabelnames the operation being undone. No-ops after the first call in a process, and is best effort: a snapshot failure never blocks the command itself. - 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.
- undo
- Restore the most recent snapshot: reset branch tips and metadata to their pre-mutation state. Refuses on a dirty worktree (it resets the current branch) and consumes the snapshot so it is one-shot.
- unset_
base_ for_ branch - unset_
parent_ for_ branch