#3 Git reader module (log/tree/show/diff/bundle/tarball)
Context: All pages need git data via CLI (no libgit2). Shared module used by code/commits/releases/bundle. Tasks:
- Module
gitx:resolve_branch(repo, flag|env|main->master),rev_parse_short,log_n(100): sha,subject,author,date,ls_tree(branch, path),show(branch:path)->bytes,diff(sha)->unified text (capped, binary-aware). - Shells out to
git -C <repo>with timeout; non-UTF8 paths handled (lossy display + raw still exact); errors are typed, never panic. snapshot(repo, branch, out):git bundle create repo.bundle <branch>+repo.tar.gzviagit archive.- Unit tests with a temp fixture repo (init, 3 commits, branch, binary file). Success rubric:
-
Tests green on fixture: log order, ls-tree dirs-first sort, show byte-exact, diff contains expected hunk, bundle clones (
git clone repo.bundleworks), tarball extracts. - Missing branch -> loud error naming tried names. Non-repo path -> clean error, exit non-zero.
-
No git command exceeds 10s (timeout tested with mocked GIT ceiling? at least timeout plumbed).
Swarm: Owl/Platinum. Branch
m1/gitx. No HTML in this issue.
Uunknown ·
Merged PR 96daee79 (m1/gitx): 16 tests green, 10s timeout plumbed, byte-exact show, bundle clones. CI pass. Rubric verified.