Expand description
Repository and unmerged-branch discovery via git shell-out. Design decision: shell-out (not git2/gix) — simple and debuggable; the product performance bottleneck is the LLM, not git.
Structs§
- Open
Loop - An open loop: an unmerged branch with its own commits.
- Repo
Candidate - A git repository discovered under a configured root (deduped by common-dir).
- Scan
Options - Options controlling a scan (light phase always; heavy phase optional + memoised).
- Worktree
Entry - One entry from
git worktree list --porcelain.
Functions§
- commit_
window - Time window of the branch-exclusive commits.
- default_
branch - Default branch: origin/HEAD’s target if it resolves locally; otherwise main; otherwise master.
- diffstat
- Diffstat of the branch against the base (for the distillation prompt).
- find_
repos - Walks roots up to
scan_depthlooking for git repo candidates, then deduplicates by absolute--git-common-dir. - git_
common_ dir - Absolute path of the git common-dir for
path(bare store /.gitdir). - git_log
- Branch-exclusive commits relative to the default (for the distillation prompt).
- open_
loops - Returns all unmerged branches (except default) in a repo, optionally reading and updating the inventory memo for ahead/behind.
- parse_
worktree_ porcelain - Parses
git worktree list --porcelaininto entries. - repo_
name_ from_ common_ dir - Derives a stable repo name from the absolute git common-dir (§5 of Spec Fase A).
- repo_
name_ hint - Path-based repo name guess when
git rev-parse --git-common-dirfails. Primary naming comes from common-dir during dedup; this is the error fallback only. - scan
- Scans all repos found under the roots in parallel.
- worktree_
map - Maps each checked-out branch to the absolute path of its worktree.