Documentation
¶
Overview ¶
Package worktreepolicy owns the pure worktree configuration format and validation. Reading a user or repository policy remains the responsibility of the caller.
Index ¶
Constants ¶
const ( Version = 1 MaxConfigSize = 64 << 10 StoreModeCentral = "central" StoreModeRepositoryLocal = "repository-local" )
Variables ¶
This section is empty.
Functions ¶
func RepositoryPlacementPolicy ¶
RepositoryPlacementPolicy rejects machine-local settings in a tracked policy.
func ValidateRetiredArchiveRepositoryName ¶
ValidateRetiredArchiveRepositoryName preserves the repository-basename grammar used by the worktrees facade, including a leading dot.
Types ¶
type BranchValidator ¶
BranchValidator checks the complete candidate ref, including the probe suffix. The caller supplies its existing Git branch grammar implementation.
type Config ¶
type Config struct {
Version int `yaml:"version"`
Worktrees struct {
BranchPrefix *string `yaml:"branch_prefix"`
// Store and Root are machine-local user policy, never repository policy.
Store *string `yaml:"store"`
Root *string `yaml:"root"`
} `yaml:"worktrees"`
// Retirement is machine-local user policy. A source repository cannot
// choose where a developer exports private Work Log evidence.
Retirement struct {
ArchiveRepository *string `yaml:"archive_repository"`
Organizations map[string]RetiredArchiveOrganizationConfig `yaml:"organizations"`
} `yaml:"retirement"`
// Umbrella configures default umbrella resolution. Both user/fleet
// (~/.config/wb/worktrees.yaml) and repository (.wb/worktrees.yaml)
// policies may set default_registry.
Umbrella struct {
DefaultRegistry *string `yaml:"default_registry"`
} `yaml:"umbrella"`
}
Config is layered user then repository. A nil prefix leaves the lower layer intact; an explicitly empty value deliberately disables it.
type RetiredArchiveOrganizationConfig ¶
type RetiredArchiveOrganizationConfig struct {
ArchiveRepository *string `yaml:"archive_repository"`
}