Documentation
¶
Overview ¶
internal/config/config.go
Index ¶
- Variables
- type Config
- func (c *Config) GetForkPoint(branch string) (string, error)
- func (c *Config) GetPR(branch string) (int, error)
- func (c *Config) GetPRBase(branch string) (string, error)
- func (c *Config) GetParent(branch string) (string, error)
- func (c *Config) GetTrunk() (string, error)
- func (c *Config) ListTrackedBranches() ([]string, error)
- func (c *Config) RemoveForkPoint(branch string) error
- func (c *Config) RemovePR(branch string) error
- func (c *Config) RemovePRBase(branch string) error
- func (c *Config) RemoveParent(branch string) error
- func (c *Config) SetForkPoint(branch, sha string) error
- func (c *Config) SetPR(branch string, pr int) error
- func (c *Config) SetPRBase(branch, base string) error
- func (c *Config) SetParent(branch, parent string) error
- func (c *Config) SetTrunk(branch string) error
Constants ¶
This section is empty.
Variables ¶
var ErrBranchNotTracked = errors.New("branch not tracked")
ErrBranchNotTracked is returned when a branch is not tracked.
var ErrNoForkPoint = errors.New("no fork point stored for branch")
ErrNoForkPoint is returned when a branch has no stored fork point.
var ErrNoPR = errors.New("no PR associated with branch")
ErrNoPR is returned when a branch has no associated PR.
var ErrNoPRBase = errors.New("no PR base stored for branch")
ErrNoPRBase is returned when a branch has no stored last-known PR base.
var ErrNotInitialized = errors.New("stack not initialized: run 'gh stack init' first")
ErrNotInitialized is returned when stack tracking is not initialized.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config provides access to stack metadata stored in .git/config.
func (*Config) GetForkPoint ¶
GetForkPoint returns the stored fork point SHA for a branch. The fork point is where the branch originally diverged from its parent.
func (*Config) GetPRBase ¶ added in v1.0.0
GetPRBase returns the last-known remote PR base branch for the given branch. This is used to detect when a PR's base transitions to trunk so the publish prompt fires only on that transition rather than on every submit run.
func (*Config) ListTrackedBranches ¶
ListTrackedBranches returns all branches that have a stackParent set.
func (*Config) RemoveForkPoint ¶
RemoveForkPoint removes the stored fork point for a branch.
func (*Config) RemovePRBase ¶ added in v1.0.0
RemovePRBase removes the stored PR base for a branch.
func (*Config) RemoveParent ¶
RemoveParent removes the parent tracking for a branch.
func (*Config) SetForkPoint ¶
SetForkPoint stores the fork point SHA for a branch.
func (*Config) SetPRBase ¶ added in v1.0.0
SetPRBase stores the last-known remote PR base branch for the given branch.