Documentation
¶
Index ¶
- func Update(bareDir string, fn func(*Stack)) error
- type Stack
- func (s *Stack) Children(branch string) []string
- func (s *Stack) Descendants(branch string) []string
- func (s *Stack) IsEmpty() bool
- func (s *Stack) IsTracked(branch string) bool
- func (s *Stack) Parent(branch string) string
- func (s *Stack) Remove(branch string)
- func (s *Stack) Roots() []string
- func (s *Stack) Save(bareDir string) error
- func (s *Stack) SetParent(branch, parent string)
- func (s *Stack) SubtreeSort(root string) []string
- func (s *Stack) TopoSort() []string
- func (s *Stack) TreeLines(branchSet map[string]bool) []TreeLine
- type TreeLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stack ¶
Stack tracks parent-child relationships between branches for stacked PRs. Stored as branches.json in the bare repo directory.
func Load ¶
Load reads the stack from branches.json. Returns an empty stack if the file doesn't exist.
func (*Stack) Children ¶
Children returns direct children of a branch (branches whose parent is this branch).
func (*Stack) Descendants ¶
Descendants returns all transitive children of a branch.
func (*Stack) Remove ¶
Remove deletes a branch from the stack and re-parents its children to the removed branch's parent.
func (*Stack) Roots ¶
Roots returns branches whose parent is NOT itself a tracked branch. These are the entry points of stacks (e.g., branches based on "main").
func (*Stack) Save ¶
Save writes the stack to branches.json. Removes the file if the stack is empty.
func (*Stack) SubtreeSort ¶
SubtreeSort returns a branch and its descendants in topological order.