stack

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer struct {
	Branch string
	PR     *github.PullRequest
	Parent string
}

func Walk

func Walk(currentBranch, trunk string, prs []github.PullRequest, localBranches map[string]bool) ([]Layer, error)

Walk returns the chain of branches from the bottom of the stack (closest to trunk) up to and including currentBranch. The first element's Parent is empty — meaning its base is the trunk.

v0.1 walks the GitHub PR graph: every branch in the chain must have a PR for it to appear in the result. If currentBranch has no PR, or any intermediate parent has no PR before reaching trunk, the function returns an empty slice (not an error) — callers should treat that as "not currently in a stack".

localBranches is reserved for v0.2 richer-validation use (e.g. rejecting chains rooted on a foreign user's branch) and is unused by the v0.1 algorithm.

Jump to

Keyboard shortcuts

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