gitgraph

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RelationCommit = &Commit{
	Row: -1,
}

RelationCommit represents an empty relation commit

Functions

This section is empty.

Types

type Commit added in v1.13.0

type Commit struct {
	Flow        int64
	Row         int
	Column      int
	Branch      string
	Rev         string
	Date        string
	Author      string
	AuthorEmail string
	ShortRev    string
	Subject     string
}

Commit represents a commit at co-ordinate X, Y with the data

func NewCommit added in v1.13.0

func NewCommit(row, column int, line []byte) (*Commit, error)

NewCommit creates a new commit from a provided line

func (*Commit) OnlyRelation added in v1.13.0

func (c *Commit) OnlyRelation() bool

OnlyRelation returns whether this a relation only commit

type Flow added in v1.13.0

type Flow struct {
	ID          int64
	ColorNumber int
	Glyphs      []Glyph
	Commits     []*Commit
	MinRow      int
	MinColumn   int
	MaxRow      int
	MaxColumn   int
}

Flow represents a series of glyphs

func NewFlow added in v1.13.0

func NewFlow(flowID int64, color, row, column int) *Flow

NewFlow creates a new flow

func (*Flow) AddGlyph added in v1.13.0

func (flow *Flow) AddGlyph(row, column int, glyph byte)

AddGlyph adds glyph at row and column

func (*Flow) Color16 added in v1.13.0

func (flow *Flow) Color16() int

Color16 wraps the color numbers around mod 16

type Glyph added in v1.13.0

type Glyph struct {
	Row    int
	Column int
	Glyph  byte
}

Glyph represents a co-ordinate and glyph

type Graph added in v1.13.0

type Graph struct {
	Flows     map[int64]*Flow
	Commits   []*Commit
	MinRow    int
	MinColumn int
	MaxRow    int
	MaxColumn int
	// contains filtered or unexported fields
}

Graph represents a collection of flows

func GetCommitGraph

func GetCommitGraph(r *git.Repository, page int, maxAllowedColors int) (*Graph, error)

GetCommitGraph return a list of commit (GraphItems) from all branches

func NewGraph added in v1.13.0

func NewGraph() *Graph

NewGraph creates a basic graph

func (*Graph) AddCommit added in v1.13.0

func (graph *Graph) AddCommit(row, column int, flowID int64, data []byte) error

AddCommit adds a commit at row, column on flowID with the provided data

func (*Graph) AddGlyph added in v1.13.0

func (graph *Graph) AddGlyph(row, column int, flowID int64, color int, glyph byte)

AddGlyph adds glyph to flows

func (*Graph) Height added in v1.13.0

func (graph *Graph) Height() int

Height returns the height of the graph

func (*Graph) Width added in v1.13.0

func (graph *Graph) Width() int

Width returns the width of the graph

type Parser added in v1.13.0

type Parser struct {
	// contains filtered or unexported fields
}

Parser represents a git graph parser. It is stateful containing the previous glyphs, detected flows and color assignments.

func (*Parser) AddLineToGraph added in v1.13.0

func (parser *Parser) AddLineToGraph(graph *Graph, row int, line []byte) error

AddLineToGraph adds the line as a row to the graph

func (*Parser) ParseGlyphs added in v1.13.0

func (parser *Parser) ParseGlyphs(glyphs []byte)

ParseGlyphs parses the provided glyphs and sets the internal state

func (*Parser) Reset added in v1.13.0

func (parser *Parser) Reset()

Reset resets the internal parser state.

Jump to

Keyboard shortcuts

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