stackutils

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDescendantBranchNames added in v0.1.14

func GetDescendantBranchNames(rootNode *StackTreeNode, branchName string) []string

GetDescendantBranchNames returns the descendant branch names of the given branch.

func GetParentBranchNames added in v0.1.14

func GetParentBranchNames(rootNode *StackTreeNode, branchName string) []string

GetParentBranchNames returns the parent branch names of the given branch. The returned slice is ordered from immediate parent to the root.

func RenderTree added in v0.0.35

func RenderTree(
	node *StackTreeNode,
	branchDataFn func(branchName string, isTrunk bool) string,
) string

Types

type StackTreeBranchInfo

type StackTreeBranchInfo struct {
	BranchName       string
	ParentBranchName string
}

type StackTreeNode

type StackTreeNode struct {
	Branch   *StackTreeBranchInfo
	Children []*StackTreeNode
}

func BuildStackTreeAllBranches added in v0.0.36

func BuildStackTreeAllBranches(
	tx meta.ReadTx,
	currentBranch string,
	sortCurrent bool,
) []*StackTreeNode

func BuildStackTreeCurrentStack added in v0.0.36

func BuildStackTreeCurrentStack(
	tx meta.ReadTx,
	currentBranch string,
	sortCurrent bool,
) (*StackTreeNode, error)

func BuildStackTreeRelatedBranchStacks added in v0.0.36

func BuildStackTreeRelatedBranchStacks(
	tx meta.ReadTx,
	currentBranch string,
	sortCurrent bool,
	relatedBranches []string,
) ([]*StackTreeNode, error)

func BuildTree added in v0.0.36

func BuildTree(
	currentBranchName string,
	branches []*StackTreeBranchInfo,
	sortCurrent bool,
) []*StackTreeNode

Jump to

Keyboard shortcuts

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