Repository navigation
Cut three duplicate git subprocesses per wt list statusline render - #2209
Merged
Merged
Conversation
- Cache `git rev-parse --git-common-dir` process-wide so multiple
`Repository::at(same_path)` calls (e.g. `init_command_log` then a
command handler) share the result.
- Canonicalize the input path inside `Repository::worktree_at()` so
callers passing equivalent forms (cwd from Claude Code JSON vs path
from `git worktree list --porcelain`) hit the same `worktree_roots`
/ `git_dirs` cache entries.
- Resolve `merge_base()` inputs through the cached `commit_shas` map
before keying the cache, so `merge-base("main", "<sha>")` and
`merge-base("main", "branch")` collapse to one entry. New
`resolve_to_commit_sha` helper short-circuits 40-char hex inputs so
resolving an already-SHA ref doesn't spawn `git rev-parse`.
Verified with a PATH-shimmed `git` wrapper: 33 → 29 git subprocesses
per render on a clean tree.
Co-Authored-By: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Apr 14, 2026
Documents the `wt-perf cache-check` workflow against a real `wt list statusline --claude-code` trace as a weekly maintenance item. Includes the exact `RUST_LOG=debug … | grep wt-trace | wt-perf cache-check` invocation, a stdin-JSON stub, triage guidance for distinguishing legitimate distinct calls from real cache misses (with the merge_base / worktree_at precedents from PR #2209), and a 29-subprocess clean-tree baseline so future regressions are visible. Co-Authored-By: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Apr 14, 2026
Captures the `wt-perf cache-check` workflow as a weekly maintenance task in the `running-tend` skill, alongside the existing MSRV bump. The render of `wt list statusline --claude-code` runs on every Claude Code prompt redraw, so any new in-process cache-miss duplicate there compounds into measurable fseventsd / IPC load — worth catching weekly rather than waiting for someone to notice the macOS daemon pegged at 100% CPU. Includes the exact `RUST_LOG=debug … | grep wt-trace | wt-perf cache-check` invocation with a stdin-JSON stub, triage guidance for distinguishing legitimate distinct calls from real cache misses (with the `merge_base` / `worktree_at` precedents from PR #2209), and a 29-subprocess clean-tree baseline so a jump above ~32 is visible. > _This was written by Claude Code on behalf of @max-sixty_ Co-authored-by: Claude <[email protected]>
worktrunk-bot
added a commit
that referenced
this pull request
Apr 14, 2026
…rename Two stale references from #2201 (verbose.log → trace.log split) and #2209 (git-common-dir caching): - Replace `VERBOSE_LOG` with `TRACE`/`OUTPUT` (the two log sinks that replaced it) in the process-level singletons list in `src/git/ repository/mod.rs`, and add `GIT_COMMON_DIR_CACHE` which was added in #2209 but missed in the inventory. - Rename `test_diagnostic_verbose_log_contains_git_commands` to `test_diagnostic_trace_log_contains_git_commands` in `tests/ integration_tests/diagnostic.rs` — the assertions already target the "Trace log" section. Rename local bindings for consistency. Pure documentation/test-naming cleanup; no behavioral change. Co-Authored-By: Claude Opus 4.6 <[email protected]>
2 of 3 tasks
max-sixty
pushed a commit
that referenced
this pull request
Apr 28, 2026
## Summary Per #2449 maintainer feedback, this PR was originally going to add skill-authoring guidance to `CLAUDE.md` and apply an audit to existing skills. The follow-up comment clarified that the *guidance itself* belongs in tend's repo (where `tend-ci-runner` skills are bundled and shared across consumers), not in worktrunk's `CLAUDE.md` — so I've dropped the `CLAUDE.md` commit. What's left is the audit fix the guidance prompted: the `running-tend` skill no longer cites the dated `Baseline as of 2026-04-13 ... (see PR #2209)` reference, just the structural rule (`~29 baseline, jump above ~32 warrants investigation`). The skill-authoring guidance itself needs to land in max-sixty/tend (likely under "Skill design: bundled for everyone, overlay for one" in that repo's CLAUDE.md). The bot doesn't have push access there, so that's a separate manual change. --------- Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude Opus 4.7 <[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.
Three in-process cache misses caused
wt list statusline --claude-codeto spawn 33 git subprocesses per render, four of which were exact-input duplicates the existing in-memory caches should have caught.git rev-parse --git-common-dirran twice — once frominit_command_logearly inmain, once from the command handler — because eachRepository::at()builds its ownRepoCache. Added a process-wideLazyLock<DashMap<PathBuf, PathBuf>>keyed by discovery path. Targeted at the dedupe alone; not sharing the wholeRepository, because per-Repository caches likecommit_shas["HEAD"]go stale after agit rebasemid-wt mergerun (an attempt to do that broke seven merge tests).git rev-parse --show-toplevel × 3and--git-dir × 2becauseWorkingTree::root()/git_dir()cache by raw input path, and statusline reaches them via two paths that resolve to the same worktree but differ in form (cwd from the Claude Code JSON vs path fromgit worktree list --porcelain).Repository::worktree_at()now canonicalizes its input (with raw fallback when the path doesn't exist yet), so equivalent forms collapse to the same cache entry.git merge-base main <sha>andgit merge-base main statusline-cache-missesran as separatemerge_base()cache entries because the key was the literal input pair.merge_base()now resolves both inputs through the cachedcommit_shasmap before keying. Newresolve_to_commit_shahelper short-circuits inputs that already look like 40-char hex SHAs, so resolving an already-SHA ref doesn't spawnrev-parse.Verified with a PATH-shimmed
gitwrapper recording every subprocess: 33 → 29 git invocations per render on a clean tree (the four duplicates above all collapse). Full test suite passes; only the three pre-existing flaky shell-wrapper PTY tests time out (same onmain).