Repository navigation
perf(list): batch commit subjects with timestamps pre-skeleton - #2369
Merged
Merged
Conversation
The pre-skeleton `git log --no-walk` call already fetched timestamps for sorting. It now also fetches subjects (via `%H\0%ct\0%s`) and primes `cache.commit_details`, so post-skeleton `CommitDetailsTask` is a pure cache hit instead of N `git log -1` forks (one per unique SHA across worktrees/branches/remotes). Subject bytes ride along for free — git has to resolve each commit object anyway, and empirical skeleton latency is unchanged (34.1ms vs 33.9ms, σ~1ms, 90+ runs). Also canonicalizes the single-shot `commit_details()` path to the same NUL format so both paths write byte-identical cache entries. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 22, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 22, 2026
…many (#2373) Fills in two gaps flagged in review of #2369 — tests only, no changes to `diff.rs`. - `commit_details_many_preserves_multibyte_utf8_subject` — pins that `"Add support for 日本語 and émoji 🎉"` round-trips through the NUL-delimited `splitn(3, '\0')` parser. - `commit_details_many_deduplicates_repeated_sha` — pins that git's `--no-walk` dedupe on a repeated input SHA surfaces as one map entry and one cache entry, so a future git change or refactor can't silently regress it. > _This was written by Claude Code on behalf of Maximilian_ Co-authored-by: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Apr 22, 2026
Now that the pre-skeleton `commit_details_many` batch fetches `(timestamp, subject)` for every item SHA (PR #2369), `CommitDetailsTask` has been a pure DashMap lookup wrapped in rayon spawn + channel send + drain match — pure overhead per item. Drop the task type and populate `ListItem.commit` from the batch map directly in the post-skeleton phase. ## Scope - Remove `CommitDetailsTask` / `TaskKind::CommitDetails` / `TaskResult::CommitDetails` and their drain + dispatch + seeding plumbing. - Sort helpers (`sort_by_timestamp_desc_with_cache`, `sort_worktrees_with_cache`) now accept the full `&HashMap<String, (i64, String)>` — single canonical source. - Post-skeleton loop writes `item.commit` from the batch map directly. `populate_item()` (the statusline single-item entry point) also does its own one-SHA `commit_details_many` lookup so `wt statusline --format=json` keeps reporting real `commit.message` / `commit.timestamp`. - Drop the old silent fallback: on batch failure, the task used to fork `git log -1` per-SHA via `Repository::commit_details()`. The `collect()` path now prints a loud warning on batch failure and renders placeholders for that run. `populate_item()` is silent on failure — the statusline has no UI for warnings. - Dead-code cleanup: `Repository::commit_details()` (singular), the `RepoCache::commit_details` DashMap field, the cache-priming side effect inside `commit_details_many`, and the circular `commit_details_and_many_store_identical_cache_entries` test. ## What stays - Batch parser tests (spaces, multibyte UTF-8, duplicate SHAs, empty input, unknown-SHA error propagation) still cover `commit_details_many` directly. - Prunable worktrees are still skipped so Age/Message render `·` — preserves the old task-queue UX for items whose directory is missing from disk. ## What's unchanged - Skeleton latency: no pre-skeleton additions. - `wt list` display: all snapshot tests pass. - `batch_ahead_behind` / `ahead_behind()` fallback: kept — that's version-compat for git < 2.36, not error-recovery. ## Codecov `codecov/patch` reports 90.90% — below the 96.63% target. The ~5 uncovered lines are the "fail loudly" batch-error warning path in `collect()` and the `bail!` for malformed git output in `commit_details_many`. Driving those from an integration test would require a pathological repo setup; the unit-test `commit_details_many_fails_loudly_on_unknown_sha` pins the contract the warning path depends on. Merging with explicit approval. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: worktrunk-bot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pre-skeleton
git log --no-walkcall already fetched timestamps for sorting. It now also fetches subjects (via%H\0%ct\0%s) and primescache.commit_details, so post-skeletonCommitDetailsTaskis a pure cache hit instead of Ngit log -1forks (one per unique SHA across worktrees/branches/remotes).Subject bytes ride along for free — git has to resolve each commit object anyway, and empirical skeleton latency is unchanged (34.1ms vs 33.9ms, σ~1ms across 90+ runs). The single-shot
commit_details()path is also canonicalized to the same NUL format so both paths write byte-identical cache entries.Verified via trace log: a single batched
git log --no-walkruns pre-skeleton; zerogit log -1forks appear in the post-skeleton hot path.