Documentation
¶
Overview ¶
Package gitcli provides native git CLI execution for blame operations. It shells out to the system git binary for blame (which uses packfile indexes and runs in milliseconds) while the rest of stringer uses go-git for commit iteration, branch listing, and repo detection. See DR-011 for rationale.
Index ¶
Constants ¶
const DefaultTimeout = 5 * time.Second
DefaultTimeout is the per-file blame timeout per DR-011.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
func Available() error
Available returns nil if git is on PATH, or an error otherwise.
func LastCommitTime ¶ added in v0.5.1
LastCommitTime returns the author time of the most recent commit that touched the given path (file or directory). Returns zero time if no commits are found.
func SetExecutor ¶ added in v0.5.1
func SetExecutor(e testable.CommandExecutor)
SetExecutor replaces the package-level CommandExecutor. Pass nil to restore the default production executor. This is intended for testing.
Types ¶
type BlameLine ¶
BlameLine holds attribution data for a single source line.
type NumstatCommit ¶ added in v1.0.0
NumstatCommit holds parsed data from a single commit in git log --numstat output.
func LogNumstat ¶ added in v1.0.0
func LogNumstat(ctx context.Context, repoDir string, maxCount int, since string) ([]NumstatCommit, error)
LogNumstat runs `git log --numstat --format=...` and returns structured per-commit data. maxCount limits the number of commits returned. If since is non-empty, it is passed as --since=<value>.