internal

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RenameThreshold specifies the percentage of removed lines that
	// still exist in destination to consider them linked.
	RenameThreshold = 40
)

Variables

This section is empty.

Functions

func NewProgressBar added in v0.2.6

func NewProgressBar(name string, total int64) *mpb.Bar

Types

type Commit

type Commit struct {
	Hash        string      `json:"hash"`
	Author      Signature   `json:"author"`
	Committer   Signature   `json:"committer"`
	Message     string      `json:"message"`
	FileChanges FileChanges `json:"files"`
	IsMerge     bool        `json:"isMerge"`
	// contains filtered or unexported fields
}

func NewCommit

func NewCommit(c *object.Commit) *Commit

type Commits

type Commits []*Commit

func (Commits) Find

func (c Commits) Find(hash string) *Commit

func (Commits) ParseFileChanges

func (c Commits) ParseFileChanges() error

type FileChange

type FileChange struct {
	Name         string  `json:"filepath"`
	IsBinary     bool    `json:"isBinary"`
	Additions    int     `json:"additions"`
	Deletions    int     `json:"deletions"`
	RawAdditions int     `json:"rawAdditions"`
	RawDeletions int     `json:"rawDeletions"`
	RenameFrom   string  `json:"renameOf,omitempty"`
	RenameTo     string  `json:"renameTo,omitempty"`
	Similarity   float32 `json:"similarity,omitempty"`
}

type FileChanges

type FileChanges []*FileChange

func NewFileChanges

func NewFileChanges(changes object.Changes) (FileChanges, error)

type Parser

type Parser struct {
	Version  string     `json:"version"`
	Projects []*Project `json:"projects"`
}

func NewParser

func NewParser() *Parser

func (*Parser) ParseProject

func (p *Parser) ParseProject(filepath string) error

type Project

type Project struct {
	Name    string  `json:"name"`
	Commits Commits `json:"commits"`
	// contains filtered or unexported fields
}

func NewProject

func NewProject(path string) (*Project, error)

func (*Project) ParseCommits

func (p *Project) ParseCommits() error

type Signature

type Signature struct {
	Name  string    `json:"name"`
	Email string    `json:"-"` // don't include email, it's redundant PI
	When  time.Time `json:"time"`
}

func NewSignature

func NewSignature(s object.Signature) Signature

Jump to

Keyboard shortcuts

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