log

package
v18.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EachPathLastCommit

func EachPathLastCommit(
	ctx context.Context,
	objectReader catfile.ObjectContentReader,
	repo gitcmd.RepositoryExecutor,
	revision git.Revision,
	paths []string,
	options *gitalypb.GlobalOptions,
	fn func(string, *catfile.Commit) error,
) error

EachPathLastCommit returns the last commit that modified each path in `paths`. It does so by calling the provided function `fn` for each path in `paths` with the related commit. It is up to the caller to decide what to do with the commit then.

func GitLogCommand

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

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

func LastCommitForPath

func LastCommitForPath(
	ctx context.Context,
	objectReader catfile.ObjectContentReader,
	repo gitcmd.RepositoryExecutor,
	revision git.Revision,
	path string,
	options *gitalypb.GlobalOptions,
) (*catfile.Commit, 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 gitcmd.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