checkoutsetup

package
v0.182.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package checkoutsetup shares checkout-creation hooks and markers below the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AfterCreate

func AfterCreate(options checkoutmarker.DescribeOptions, stderr io.Writer, results []worktrees.CreateResult, deps MarkerDependencies)

AfterCreate is best-effort: marker diagnostics never undo an admitted checkout.

func BeforeCreate

func BeforeCreate(root string, repositories []string, deps HookDependencies) error

Types

type HookDependencies

type HookDependencies struct {
	Canonical  func(string, string) (string, error)
	Refresh    func(string, string, string, string) (bool, error)
	Executable func() string
}

func DefaultHookDependencies

func DefaultHookDependencies(executable func() string) HookDependencies

type MarkerDependencies

type MarkerDependencies struct {
	Describe func(string, checkoutmarker.DescribeOptions) (checkoutmarker.Inspection, error)
	Apply    func(checkoutmarker.Descriptor, string) (checkoutmarker.Result, error)
}

func DefaultMarkerDependencies

func DefaultMarkerDependencies() MarkerDependencies

type MarkerOutcome

type MarkerOutcome struct {
	Path           string `json:"path"`
	Kind           string `json:"kind"`
	Repository     string `json:"repository,omitempty"`
	Task           string `json:"task,omitempty"`
	Branch         string `json:"branch,omitempty"`
	Writable       bool   `json:"writable"`
	MarkerWritten  bool   `json:"marker_written"`
	ExcludeWritten bool   `json:"exclude_written"`
	Error          string `json:"error,omitempty"`
}

type MarkerRequest

type MarkerRequest struct {
	Options       checkoutmarker.DescribeOptions
	Filter        string
	Fleet, DryRun bool
	Paths         []string
}

type MarkerRunDependencies

type MarkerRunDependencies struct {
	Marker              MarkerDependencies
	ScanLocal           func(string) ([]discover.Repo, error)
	RegisteredWorktrees func(context.Context, string) []string
}

func DefaultMarkerRunDependencies

func DefaultMarkerRunDependencies() MarkerRunDependencies

type Markers

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

func NewMarkers

func NewMarkers(deps MarkerRunDependencies) *Markers

func (*Markers) AfterRelocate

func (s *Markers) AfterRelocate(results []worktrees.RelocateResult, options checkoutmarker.DescribeOptions, stderr io.Writer)

func (*Markers) AfterRename

func (s *Markers) AfterRename(results []worktrees.RenameResult, options checkoutmarker.DescribeOptions, stderr io.Writer)

func (*Markers) RefreshSynced

func (s *Markers) RefreshSynced(results []fleetsync.Result, options checkoutmarker.DescribeOptions, errOut io.Writer)

func (*Markers) Run

func (s *Markers) Run(ctx context.Context, req MarkerRequest) ([]MarkerOutcome, error)

type Ownership

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

func NewOwnership

func NewOwnership(deps OwnershipDependencies) *Ownership

func (*Ownership) Record

func (s *Ownership) Record(req OwnershipRequest) (OwnershipResult, error)

type OwnershipDependencies

type OwnershipDependencies struct {
	Abs             func(string) (string, error)
	IdentityFromEnv func() worktrees.AgentIdentity
	RecordCustody   func(string, string, string, worktrees.AgentIdentity) error
}

func DefaultOwnershipDependencies

func DefaultOwnershipDependencies() OwnershipDependencies

type OwnershipRequest

type OwnershipRequest struct {
	Path                string
	Admitted, Overrides worktrees.AgentIdentity
}

type OwnershipResult

type OwnershipResult struct {
	Path     string
	Identity worktrees.AgentIdentity
}

Jump to

Keyboard shortcuts

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