Documentation
¶
Overview ¶
Package track implements the stackit track command for tracking branches in a stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶ added in v0.30.1
Deps are the collaborators track needs. Adapters build them from their own runtime state; the action never sees bootstrap types.
type Engine ¶ added in v0.30.1
type Engine interface {
actions.OwnershipEngine
CurrentBranch(ctx context.Context) *engine.Branch
Trunk() engine.Branch
AllBranches() engine.Branches
BranchNames() *engine.BranchSet
GetRevision(ctx context.Context, branch engine.Branch) (string, error)
BatchRevisions(ctx context.Context, branches engine.Branches) engine.RevisionMap
GetMergeBase(ctx context.Context, rev1, rev2 string) (string, error)
IsAncestor(ctx context.Context, ancestor, descendant string) (bool, error)
FindMostRecentTrackedAncestors(ctx context.Context, branchName string) ([]string, error)
TrackBranch(ctx context.Context, branchName string, parentBranchName string) error
ConfigureRemoteMetadataSync(ctx context.Context) error
}
Engine lists exactly the engine methods track calls. The interactive parent picker (Handler.PromptSelectParent) brings its own collaborators from the adapter.
type Handler ¶
type Handler interface {
// PromptSelectParent prompts user to select a parent for the branch
// Returns the selected parent branch name. The adapter supplies whatever
// the picker needs (engine, GitHub client, logger) when building the handler.
PromptSelectParent(ctx context.Context, branchName string) (string, error)
// PromptTrackChild prompts user to confirm tracking a child branch
// Returns true to track the child, false to skip
PromptTrackChild(childName, parentName string) (bool, error)
// Cleanup restores terminal state (may be no-op)
Cleanup()
// IsInteractive returns true if the handler supports interactive prompts
IsInteractive() bool
}
Handler receives events from track action
type NullHandler ¶
NullHandler is a no-op handler for when nil is passed
func (*NullHandler) PromptSelectParent ¶
PromptSelectParent implements Handler. Returns empty string for null handler.
func (*NullHandler) PromptTrackChild ¶
func (h *NullHandler) PromptTrackChild(_, _ string) (bool, error)
PromptTrackChild implements Handler. Returns false for null handler.
Click to show internal directories.
Click to hide internal directories.