log

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommit

func GetCommit(ctx context.Context, repo *pb.Repository, revision string, path string) (*pb.GitCommit, error)

GetCommit returns a single GitCommit

func GitLogCommand

func GitLogCommand(ctx context.Context, repo *pb.Repository, revisions []string, paths []string, extraArgs ...string) (*command.Command, error)

GitLogCommand returns a Command that executes git log with the given the arguments

Types

type Parser

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

Parser holds necessary state for parsing a git log stream

func NewLogParser

func NewLogParser(ctx context.Context, repo *pb.Repository, src io.Reader) (*Parser, error)

NewLogParser returns a new Parser

func (*Parser) Commit

func (parser *Parser) Commit() *pb.GitCommit

Commit returns a successfully parsed git log line. It should be called only when Parser.Parse() returns true.

func (*Parser) Err

func (parser *Parser) Err() error

Err returns the error encountered (if any) when parsing the diff stream. It should be called only when Parser.Parse() returns false.

func (*Parser) Parse

func (parser *Parser) Parse() bool

Parse parses a single git log line. It returns true if successful, false if it finished parsing all logs or when it encounters an error, in which case use Parser.Err() to get the error.

Jump to

Keyboard shortcuts

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