Fix #301: per-entry last-commit dates #308

Merged
crueber merged 2 commits from fix/issue-301 into main 2026-09-10 21:43:47 +00:00
Owner

Fixes #301 — the Code tab stamped the repo HEAD date on every tree row. TreeEntry gains commit_sha + commit_time (omitempty, additive JSON), computed by ONE batched git log walk per listing (first-parent, --no-renames, -z, --max-count=server.max_tree_log, default 200); submodules and capped entries stay dateless with a neutral em-dash fallback. Tree.jsx drops the HEAD-stamp proxy (extra commits?n=1 fetch gone — zero extra round trips). Payload stays sha-pure (ETag/SWR unchanged), zero store round trips added, fail-open on walk errors. Tests: table-driven assignment (newest-wins, subdir prefix, cap, submodules, malformed, 1-char paths) + real-git integration + setup round-trip + bound validation; api/config -race green, e2e green, node suite green (8 env-only marked-package failures pass with node_modules present), vite build green. Docs: 07_api §9.4 + Decisions, 04_git argv registry, 11_config_cli key row, 12_web_ui entry. Browser proof open (shared-daemon loopback guard).

Fixes #301 — the Code tab stamped the repo HEAD date on every tree row. TreeEntry gains `commit_sha` + `commit_time` (omitempty, additive JSON), computed by ONE batched `git log` walk per listing (first-parent, --no-renames, -z, --max-count=server.max_tree_log, default 200); submodules and capped entries stay dateless with a neutral em-dash fallback. Tree.jsx drops the HEAD-stamp proxy (extra commits?n=1 fetch gone — zero extra round trips). Payload stays sha-pure (ETag/SWR unchanged), zero store round trips added, fail-open on walk errors. Tests: table-driven assignment (newest-wins, subdir prefix, cap, submodules, malformed, 1-char paths) + real-git integration + setup round-trip + bound validation; api/config -race green, e2e green, node suite green (8 env-only marked-package failures pass with node_modules present), vite build green. Docs: 07_api §9.4 + Decisions, 04_git argv registry, 11_config_cli key row, 12_web_ui entry. Browser proof open (shared-daemon loopback guard).
TreeEntry gains commit_sha + commit_time (omitempty, additive JSON),
computed by ONE batched git log walk per listing (first-parent,
no-renames, -z, --max-count=server.max_tree_log, default 200) assigning
each direct child its newest touching commit; submodules and capped
entries stay dateless. Tree.jsx drops the HEAD-stamp proxy and renders
each row's own date via the #133 DateTime (em-dash fallback).

Docs: 07_api §9.4 recipe + Decisions, 04_git argv registry,
11_config_cli key row, 12_web_ui entry.
assignTreeCommitMeta sniffed headers by content in every record
position, so a path literally named 'WALHUBTREE <sha> <date>'
poisoned later attributions (valid shape) or cleared haveCommit and
orphaned the rest of the commit (near-miss shape). Headers now split
positionally: MARK is a header only in status position; in path
position the record is always the touched path (--no-renames emits no
pairs, so status is always followed by exactly one path). Regression
table test included; fails on the old code, passes on the new.
Sign in to join this conversation.
No description provided.