lib

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package lib implements the core logic for git-branch-tree: fetching branch data from git, building the in-memory tree, and invoking the renderer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	// Verbose defines whether to print internal data structures to stderr.
	Verbose bool

	// Renderer specifies which library to use for output.
	Renderer t.Renderer

	// All causes us to include remote-tracking branches (-a).
	All bool

	// Collapse, if true, causes us to merge branches at the same commit into one node.
	Collapse bool

	// BranchSeparator is the separator used when collapsing branch names.
	BranchSeparator string

	// HighlightCurrentBranch specifies whether to colour the current branch green.
	HighlightCurrentBranch bool

	// HighlightOtherBranch is a list of branch names to colour blue.
	HighlightOtherBranch []string

	// FullRefs tells us to use full refs (refs/heads/…) instead of short names.
	FullRefs bool
}

Cfg holds the configuration derived from command-line flags.

func (*Cfg) ExecuteHistory

func (cfg *Cfg) ExecuteHistory()

ExecuteHistory builds and prints the branch tree using commit-history ancestry: a branch is a child of the branch whose tip commit appears in its history at the point where both histories diverge.

func (*Cfg) ExecuteUpstream

func (cfg *Cfg) ExecuteUpstream()

ExecuteUpstream builds and prints the branch tree using each branch's configured upstream tracking branch as the parent relationship.

Directories

Path Synopsis
Package common provides small utilities shared across git-branch-tree.
Package common provides small utilities shared across git-branch-tree.
Package render prints a branch tree to stdout using one of several third-party rendering libraries selected at runtime.
Package render prints a branch tree to stdout using one of several third-party rendering libraries selected at runtime.
Package types defines the core data structures shared across git-branch-tree.
Package types defines the core data structures shared across git-branch-tree.

Jump to

Keyboard shortcuts

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