config

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config reads git-stack settings from `git config stack.*`.

Index

Constants

View Source
const (
	KeyBranchPrefix   = "stack.branchPrefix"
	KeyAICommand      = "stack.ai.command"
	KeyAIModel        = "stack.ai.model"
	KeyAIExtraPrompt  = "stack.ai.extraPrompt"
	KeyAITimeout      = "stack.ai.timeout"
	KeyAIAuto         = "stack.ai.auto"
	KeyCacheTTL       = "stack.cacheTTL"
	KeySubmitDefault  = "stack.submit.default"
	KeySyncPrune      = "stack.sync.prune"
	KeyMergeMethod    = "stack.merge.method"
	KeyManagedAliases = "stack.managedAliases"
	KeyManagedFiles   = "stack.managedFiles"
)

Config keys (git config is case-insensitive; these are the canonical forms).

View Source
const (
	SubmitAsk     = "ask"
	SubmitDraft   = "draft"
	SubmitPublish = "publish"
)

SubmitDefault values.

View Source
const (
	SyncPruneAlways = "always"
	SyncPruneAsk    = "ask"
	SyncPruneNever  = "never"
)

SyncPrune values: what sync does with branches whose PRs have merged.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BranchPrefix  string
	AICommand     string
	AIModel       string
	AIExtraPrompt string
	AITimeout     time.Duration
	// AIAuto makes create and submit behave as if --ai was passed, unless
	// --no-ai is given.
	AIAuto   bool
	CacheTTL time.Duration
	// SubmitDefault is publish (default), draft or ask.
	SubmitDefault string
	// SyncPrune is always (default), ask or never.
	SyncPrune string
	// MergeMethod is merge, squash or rebase; empty leaves it to the
	// repository's settings.
	MergeMethod    string
	ManagedAliases []string
	ManagedFiles   []string
}

Config holds the effective settings.

func Defaults

func Defaults() *Config

Defaults returns the built-in defaults.

func FromEntries

func FromEntries(entries []git.ConfigEntry) (*Config, error)

FromEntries builds a Config from raw git config entries.

func Load

func Load(ctx context.Context, g *git.Client, repo git.Repo) (*Config, error)

Load reads every stack.* key visible from repo (merged scopes) on top of the defaults. Invalid values are reported as errors naming the key.

Jump to

Keyboard shortcuts

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