log

package
v16.2.0-rc44 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitLogCommand

func GitLogCommand(ctx context.Context, gitCmdFactory git.CommandFactory, repo storage.Repository, revisions []git.Revision, paths []string, options *gitalypb.GlobalOptions, extraArgs ...git.Option) (*command.Command, error)

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

func IsNotFound

func IsNotFound(err error) bool

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

func LastCommitForPath

func LastCommitForPath(
	ctx context.Context,
	gitCmdFactory git.CommandFactory,
	objectReader catfile.ObjectContentReader,
	repo storage.Repository,
	revision git.Revision,
	path string,
	options *gitalypb.GlobalOptions,
) (*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 NewParser

func NewParser(ctx context.Context, catfileCache catfile.Cache, repo git.RepositoryExecutor, src io.Reader) (*Parser, func(), error)

NewParser 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(ctx context.Context) 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