log

package
v0.114.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: MIT Imports: 16 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) (*pb.GitCommit, error)

GetCommit tries to resolve revision to a Git commit. Returns nil if no object is found at revision.

func GetCommitCatfile added in v0.110.0

func GetCommitCatfile(c *catfile.Batch, revision string) (*pb.GitCommit, error)

GetCommitCatfile looks up a commit by revision using an existing *catfile.Batch instance.

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

func LastCommitForPath added in v0.110.0

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

LastCommitForPath returns the last commit which modified path.

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