config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: BlueOak-1.0.0 Imports: 7 Imported by: 0 modules, 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

internal/config/config.go

Index

Constants

This section is empty.

Variables

View Source
var ErrBranchNotTracked = errors.New("branch not tracked")

ErrBranchNotTracked is returned when a branch is not tracked.

View Source
var ErrNoForkPoint = errors.New("no fork point stored for branch")

ErrNoForkPoint is returned when a branch has no stored fork point.

View Source
var ErrNoPR = errors.New("no PR associated with branch")

ErrNoPR is returned when a branch has no associated PR.

View Source
var ErrNoPRBase = errors.New("no PR base stored for branch")

ErrNoPRBase is returned when a branch has no stored last-known PR base.

View Source
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 Load

func Load(repoPath string) (*Config, error)

Load creates a Config for the repository at the given path.

func (*Config) GetForkPoint

func (c *Config) GetForkPoint(branch string) (string, error)

GetForkPoint returns the stored fork point SHA for a branch. The fork point is where the branch originally diverged from its parent.

func (*Config) GetPR

func (c *Config) GetPR(branch string) (int, error)

GetPR returns the PR number for the given branch.

func (*Config) GetPRBase added in v1.0.0

func (c *Config) GetPRBase(branch string) (string, error)

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) GetParent

func (c *Config) GetParent(branch string) (string, error)

GetParent returns the parent branch for the given branch.

func (*Config) GetTrunk

func (c *Config) GetTrunk() (string, error)

GetTrunk returns the configured trunk branch name.

func (*Config) ListTrackedBranches

func (c *Config) ListTrackedBranches() ([]string, error)

ListTrackedBranches returns all branches that have a stackParent set.

func (*Config) RemoveForkPoint

func (c *Config) RemoveForkPoint(branch string) error

RemoveForkPoint removes the stored fork point for a branch.

func (*Config) RemovePR

func (c *Config) RemovePR(branch string) error

RemovePR removes the PR association for a branch.

func (*Config) RemovePRBase added in v1.0.0

func (c *Config) RemovePRBase(branch string) error

RemovePRBase removes the stored PR base for a branch.

func (*Config) RemoveParent

func (c *Config) RemoveParent(branch string) error

RemoveParent removes the parent tracking for a branch.

func (*Config) SetForkPoint

func (c *Config) SetForkPoint(branch, sha string) error

SetForkPoint stores the fork point SHA for a branch.

func (*Config) SetPR

func (c *Config) SetPR(branch string, pr int) error

SetPR sets the PR number for the given branch.

func (*Config) SetPRBase added in v1.0.0

func (c *Config) SetPRBase(branch, base string) error

SetPRBase stores the last-known remote PR base branch for the given branch.

func (*Config) SetParent

func (c *Config) SetParent(branch, parent string) error

SetParent sets the parent branch for the given branch.

func (*Config) SetTrunk

func (c *Config) SetTrunk(branch string) error

SetTrunk sets the trunk branch name.

Jump to

Keyboard shortcuts

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