Skip to content

@saflib/git


Function: log()

log(repoRoot, options): ReturnsError<GitCommit[], GitCommandError>>

Walk commits on ref (default HEAD), newest first — same order as git log. Uses --first-parent so merge commits don't fan the walk out.

Field format is controlled here so callers never parse raw git pretty-format strings themselves.

Parameters

ParameterType
repoRootstring
optionsLogOptions

Returns

ReturnsError<GitCommit[], GitCommandError>