Documentation
¶
Overview ¶
Package reorder implements the reorder command, which reorders the branches between trunk and the current branch and restacks their descendants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCanceled = errors.New("reorder canceled")
ErrCanceled is returned by an OrderEditor when the user cancels.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Engine Engine
actions.MutationDeps
}
Deps are the collaborators reorder needs. Adapters build them from their own runtime state; the action never sees bootstrap types.
type Engine ¶
type Engine interface {
validation.GitOperationEngine
actions.OwnershipEngine
Trunk() engine.Branch
Graph(ctx context.Context, strategy engine.SortStrategy) *engine.StackGraph
ReparentBranchesToParents(ctx context.Context, moves []engine.BranchParentMove, opts engine.ReparentOpts) error
}
Engine lists exactly the engine methods reorder calls: the precondition checks, the ownership guard, the stack reads, and the parent rewrite.
type Options ¶
type Options struct {
// Editor is the interactive order editor. When nil, the order is edited
// as text in $EDITOR instead.
Editor OrderEditor
}
Options configures Action.
type OrderEditor ¶
type OrderEditor interface {
// EditOrder receives branches tip-first (trunk is passed only for
// display) and returns the new tip-first order. It returns
// ErrCanceled when the user cancels.
EditOrder(branchesTipFirst []string, trunk string) ([]string, error)
}
OrderEditor lets the user interactively choose a new branch order. Implementations live in adapters (e.g. the CLI's Bubble Tea reorder view).
Click to show internal directories.
Click to hide internal directories.