Documentation
¶
Overview ¶
Package pluck provides functionality for extracting a single branch from a stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler interface {
// Start is called at the beginning of pluck
Start(sourceBranch, oldParent, newParent string)
// OnStep is called for each step in the pluck process
OnStep(step Step, status basehandler.StepStatus, message string)
// OnChildReparented is called when a child is reparented to the grandparent
OnChildReparented(child, oldParent, newParent string)
// Complete is called when pluck finishes
Complete(result Result)
// Cleanup restores terminal state (may be no-op)
Cleanup()
// IsInteractive returns true if the handler supports interactive prompts
IsInteractive() bool
// PromptConfirmPluck displays a preview of the pluck and asks for confirmation.
// Returns true to proceed with the pluck, false to cancel.
// In non-interactive mode, returns true (auto-confirm).
PromptConfirmPluck(preview Preview) (bool, error)
}
Handler receives events from pluck action
type NullHandler ¶
type NullHandler struct {
basehandler.NullBase
basehandler.NullProgress[Step]
}
NullHandler is a no-op handler for when nil is passed. It embeds basehandler.NullBase for Cleanup() and IsInteractive(), and basehandler.NullProgress[Step] for OnStep().
func (*NullHandler) OnChildReparented ¶
func (h *NullHandler) OnChildReparented(string, string, string)
OnChildReparented implements Handler.
func (*NullHandler) PromptConfirmPluck ¶
func (h *NullHandler) PromptConfirmPluck(Preview) (bool, error)
PromptConfirmPluck implements Handler. Returns true (auto-confirm) for null handler.
type Options ¶
type Options struct {
Source string // Branch to pluck (defaults to current branch)
Onto string // Branch to pluck onto
SkipConfirm bool // Skip confirmation prompt (--yes flag)
}
Options contains options for the pluck command
type Preview ¶
type Preview struct {
SourceBranch string // Branch being plucked
OldParent string // Current parent of source
NewParent string // Target parent for source
Children []string // Direct children that will be reparented
ChildNewParent string // Where children will be reparented (grandparent)
Commits []string // Commit subjects on the source branch
}
Preview contains information about the planned pluck for confirmation
Click to show internal directories.
Click to hide internal directories.