{"modulePath":"github.com/davetashner/stringer","version":"v1.11.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitcli\n\nPackage 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.\n\n## Constants\n\n```go\nconst DefaultTimeout = 5 * time.Second\n```\nDefaultTimeout is the per-file blame timeout per DR-011.\n\n## Functions\n\n```go\nfunc Available() error\n```\nAvailable returns nil if git is on PATH, or an error otherwise.\n\n```go\nfunc Exec(ctx context.Context, repoDir string, args ...string) (string, error)\n```\nExec runs git with the given arguments in repoDir and returns combined stdout.\n\n```go\nfunc LastCommitTime(ctx context.Context, repoDir, path string) (time.Time, error)\n```\nLastCommitTime 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.\n\n```go\nfunc ListTrackedFiles(ctx context.Context, repoDir string) (map[string]bool, error)\n```\nListTrackedFiles runs \\`git ls-files -z\\` in repoDir and returns the set of tracked file paths (relative to repoDir, slash-separated as git emits them). Returns an error when repoDir is not inside a git work tree or git is unavailable.\n\n```go\nfunc SetExecutor(e testable.CommandExecutor)\n```\nSetExecutor replaces the package-level CommandExecutor. Pass nil to restore the default production executor. This is intended for testing.\n\n## Types\n\n```go\ntype BlameLine struct {\n\tAuthorName string\n\tAuthorTime time.Time\n}\n```\nBlameLine holds attribution data for a single source line.\n\n```go\nfunc BlameFile(ctx context.Context, repoDir, relPath string) ([]BlameLine, error)\n```\nBlameFile runs \\`git blame --porcelain -- \\\u003crelPath\u003e\\` and returns one BlameLine per source line.\n\n```go\nfunc BlameSingleLine(ctx context.Context, repoDir, relPath string, line int) (*BlameLine, error)\n```\nBlameSingleLine runs \\`git blame --porcelain -L \\\u003cline\u003e,\\\u003cline\u003e -- \\\u003crelPath\u003e\\` and returns the attribution for that line.\n\n```go\ntype NumstatCommit struct {\n\tSHA        string\n\tAuthor     string\n\tAuthorTime time.Time\n\tFiles      []string\n}\n```\nNumstatCommit holds parsed data from a single commit in git log --numstat output.\n\n```go\nfunc LogNumstat(ctx context.Context, repoDir string, maxCount int, since string) ([]NumstatCommit, error)\n```\nLogNumstat 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=\\\u003cvalue\u003e.\n\n","path":"github.com/davetashner/stringer/internal/gitcli","name":"gitcli","synopsis":"Package gitcli provides native git CLI execution for blame operations.","isRedistributable":true}
