Documentation
¶
Overview ¶
Package create provides functionality for creating new stacked branches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
// Start is called at the beginning of create
Start(parentBranch string)
// OnStep is called for each step in the create process
OnStep(step Step, status handler.StepStatus, message string)
// Complete is called when create finishes
Complete(result Result)
// Cleanup restores terminal state (may be no-op)
Cleanup()
// IsInteractive returns true if the handler supports interactive prompts
IsInteractive() bool
// PromptStageChanges prompts user to stage unstaged changes
PromptStageChanges() (bool, error)
// PromptScope prompts user for a scope value when pattern contains {scope}
// The patternHint shows the current branch pattern to the user
PromptScope(patternHint string) (string, error)
}
Handler receives events from create action
type NullHandler ¶
type NullHandler struct {
handler.NullBase
handler.NullProgress[Step]
}
NullHandler is a no-op handler for when nil is passed
func (*NullHandler) Complete ¶
func (h *NullHandler) Complete(_ Result)
Complete implements Handler.
func (*NullHandler) PromptScope ¶
func (h *NullHandler) PromptScope(_ string) (string, error)
PromptScope implements Handler.
func (*NullHandler) PromptStageChanges ¶
func (h *NullHandler) PromptStageChanges() (bool, error)
PromptStageChanges implements Handler.
type Options ¶
type Options struct {
BranchName string
Message string
Scope string
All bool
Insert bool
Patch bool
Update bool
Verbose int
BranchPattern config.BranchPattern
// SelectedChildren is used to specify which children to move during insert
// in non-interactive mode (mostly for tests)
SelectedChildren []string
// Worktree creates a dedicated worktree for this stack (only valid from trunk)
Worktree bool
}
Options contains options for the create command
Click to show internal directories.
Click to hide internal directories.