{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitlog\n\nPackage gitlog is a tiny, dependency-free reader over \\`git log\\`, shared by the context compiler, provenance, predict and producer attribution. All functions degrade to empty results when git is unavailable or the path has no history.\n\n## Functions\n\n```go\nfunc Roots(ctx context.Context, dir string) []string\n```\nRoots discovers every independent git work-tree root at or under dir. If dir itself is inside a work tree, that single root is returned — the common single-repo case, unchanged in cost and result. Otherwise dir is walked (bounded by depth and total directories visited) looking for nested \".git\" entries; each one found is recorded as a root and its subtree is NOT descended into further, since it owns everything below it. Hidden directories and common dependency/build directories are skipped. Order is deterministic (sorted).\n\n## Types\n\n```go\ntype Commit struct {\n\tHash        string `json:\"hash\"`\n\tAuthor      string `json:\"author\"`\n\tAuthorEmail string `json:\"author_email\"`\n\tDate        string `json:\"date\"`\n\tSubject     string `json:\"subject\"`\n\tBody        string `json:\"body\"`\n}\n```\nCommit is one entry from git history.\n\n```go\nfunc First(ctx context.Context, root, path string) (Commit, bool)\n```\nFirst returns the commit that introduced path, if any.\n\n```go\nfunc Recent(ctx context.Context, root, path string, n int) []Commit\n```\nRecent returns up to n most-recent commits touching path (\"\" or \".\" = whole repo), newest first. For the whole-repo case, root may be the parent of several independent repositories (e.g. two sibling projects under one non-git workspace dir) rather than a repo itself — Roots discovers every repo underneath and the results are merged by date.\n\n","path":"github.com/memcode-ai/memcode/internal/gitlog","name":"gitlog","synopsis":"Package gitlog is a tiny, dependency-free reader over `git log`, shared by the context compiler, provenance, predict and producer attribution.","isRedistributable":true}
