stackparser

package
v0.0.0-...-215cd0b Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	commitgraph.Node
	// Keys are stack names
	// Values are 0 for any commits without branches,
	// or 1+ for commmits with branches.
	// A score of N indicates this commit was reachable following parent edges
	// from a commit with score N+1
	StackBranchScore map[string]int
}

type NoTotalOrderError

type NoTotalOrderError struct {
	StackName string
	// Each entry has length two
	IncomparableBranchPairs [][]string
}

func (NoTotalOrderError) Error

func (e NoTotalOrderError) Error() string

type Stack

type Stack struct {
	Name    string
	Commits map[string]*Commit // Guaranteed to not be empty
}

func GetCurrent

func GetCurrent(stacks []Stack, currCommit string) (Stack, error)

func ParseStacks

func ParseStacks(log libgit.Log) ([]Stack, error)

ParseStacks parses commit stacks from the git commit log

func (Stack) Branches

func (s Stack) Branches() []string

func (Stack) DivergesFrom

func (s Stack) DivergesFrom() map[string]struct{}

func (Stack) IsCurrent

func (s Stack) IsCurrent(currCommit string) bool

func (Stack) TotalOrderedBranches

func (s Stack) TotalOrderedBranches() ([]string, error)

TotalOrderedBranches returns all branches associated with all commits in the stack. Guaranteed to return at least one branch. If invalid, returns NoTotalOrderError.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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