lib

package
v0.0.0-...-aceff83 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindRepoRoot

func FindRepoRoot() (string, error)

func MakeTempCopyOfRepo

func MakeTempCopyOfRepo(repoPath string, tempPath string) (*git.Repository, error)

Clone the repo into a temp folder

func OpenRepoInMemory

func OpenRepoInMemory(path string) (*git.Repository, error)

Clone the repo in memory

func WalkUpRepoHistory

func WalkUpRepoHistory(repo *git.Repository, observer HistoryObserver) error

Types

type GitMetric

type GitMetric interface {
	MetricCalculator
	GraphRenderer
	IsReadOnly() bool
}

type GraphRenderer

type GraphRenderer interface {
	RenderGraph(samples []Sample, output io.Writer) error
}

type HistoryObserver

type HistoryObserver func(*object.Commit, *git.Worktree) error

type MetricCalculator

type MetricCalculator interface {
	CalculateMetrics(repo *git.Worktree) (map[string]int, error)
}

type Options

type Options struct {
	CommitLimit int
	TimeLimit   time.Time
}

func (Options) WalkUpRepoHistory

func (o Options) WalkUpRepoHistory(repo *git.Repository, observer HistoryObserver) error

type Sample

type Sample struct {
	Commit       *object.Commit
	Measurements map[string]int
}

func CalculateMetrics

func CalculateMetrics(repo *git.Repository, m MetricCalculator) ([]Sample, error)

Jump to

Keyboard shortcuts

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