Help us shape the future of Go! Take the 2026 Go Developer Survey

branch

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	// contains filtered or unexported fields
}

func New

func New(appConfig *config.AppConfig) Branch

func (Branch) GetRootCmd

func (b Branch) GetRootCmd() *cobra.Command

type MergePrompter added in v0.14.0

type MergePrompter interface {
	mergeflow.Prompter // PickStrategy, ConfirmMerge, ComposeMessage
	PickSource(ctx context.Context, sources []SourceBranch) (SourceBranch, error)
	ConfirmRemoveWorktree(ctx context.Context, path string) (remove bool, err error)
	ConfirmDeleteSource(ctx context.Context, source string) (delete bool, err error)
}

MergePrompter resolves every user-facing decision in the branch-merge flow. huhMergePrompter drives huh forms; merge_prompter_test.go provides a scripted implementation for the E2E tests.

type PrunePrompter added in v0.9.6

type PrunePrompter interface {
	// ConfirmPrune is called only when there is at least one branch to delete
	// or to mark merged, AND the run is not a dry-run.
	ConfirmPrune(ctx context.Context, toDelete, toMerge int) (confirmed bool, err error)
}

PrunePrompter resolves the single user-facing decision in the prune flow: whether to proceed with the destructive store mutations after the summary has been printed. The production implementation drives a huh form; the auto-confirm implementation (wired via --yes) returns true unconditionally; the scripted implementation in prune_prompter_test.go returns canned values for tests.

type SourceBranch added in v0.14.0

type SourceBranch struct {
	Name       string
	RemoteOnly bool
}

SourceBranch is one pickable merge source. RemoteOnly marks a branch that exists on origin but not locally, so the picker can label it and runMerge knows to materialize it before merging.

type TrackerPrunePrompter added in v0.10.0

type TrackerPrunePrompter interface {
	// DecideReap returns a map from candidate BranchName to action, where
	// action is one of: "safe", "force", "skip". Callers must not invoke
	// DecideReap with an empty candidates slice.
	DecideReap(ctx context.Context, candidates []trackerCandidate) (map[string]string, error)
}

TrackerPrunePrompter resolves the per-branch reap action for the whole candidate batch in a single call. Mirrors PrunePrompter's role in the existing prune flow.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL