log

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCommit

func GetCommit(ctx context.Context, repo *gitalypb.Repository, revision string) (*gitalypb.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) (*gitalypb.GitCommit, error)

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

func GetCommitMessage added in v1.13.0

func GetCommitMessage(c *catfile.Batch, repo *gitalypb.Repository, revision string) ([]byte, error)

GetCommitMessage looks up a commit message and returns it in its entirety.

func GetTagCatfile added in v1.21.0

func GetTagCatfile(c *catfile.Batch, tagID, tagName string) (*gitalypb.Tag, error)

GetTagCatfile looks up a commit by tagID using an existing *catfile.Batch instance. note: we pass in the tagName because the tag name from refs/tags may be different than the name found in the actual tag object. We want to use the tagName found in refs/tags

func GitLogCommand

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

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

func IsNotFound added in v1.15.0

func IsNotFound(err error) bool

IsNotFound tests if an error is a "not found" error.

func LastCommitForPath added in v0.110.0

func LastCommitForPath(ctx context.Context, repo *gitalypb.Repository, revision string, path string) (*gitalypb.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 *gitalypb.Repository, src io.Reader) (*Parser, error)

NewLogParser returns a new Parser

func (*Parser) Commit

func (parser *Parser) Commit() *gitalypb.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