docs(list): document pre-skeleton fork inventory - #2883
Conversation
Replace "Fixed Command Count" in collect/mod.rs with "Forks on the Critical Path": the six git subprocess forks on the path to the skeleton, with source method and role for each. Adds the "looks like a fork but isn't" list of `config_last` lookups served from the prewarmed in-memory map, and calls out the one-per-repo `git ls-remote` fallback in `default_branch()`. A new "#6 — the batched commit-details fork" subsection breaks down `git log --no-walk --no-show-signature --format=%H%x00%h%x00%ct%x00%s` field by field: why each flag is there, what each format field is, which post-skeleton cell it feeds, and the ARG_MAX bound on argv length. `picker/mod.rs` gains a one-sentence pointer onto the existing Time-to-skeleton line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
worktrunk-bot
left a comment
There was a problem hiding this comment.
Two factual snags in the inventory — see inline. The bigger one is that fork #3 doesn't actually fire on the steady-state path for normal repos: Repository::at consumes GIT_CONFIG_PRELOAD (the parsed map from #2) into cache.all_config via .set() at src/git/repository/mod.rs:528-531, so the get_or_try_init inside all_config is a memory hit, not a fork. The prewarm_git_config docstring itself spells this out — all_config only re-forks "when the parsed map contains extensions.worktreeconfig=true" (src/git/repository/mod.rs:773-778). That makes the new "six forks on the critical path" headline an overcount for the typical case (it's five), and contradicts the "Things that look like forks but aren't" list below where Repository::is_bare is described as "served from #2's in-memory map" — which is only true because #3 didn't fire.
The other one is smaller: Repository::url_template isn't a config_last("…") lookup at all — it reads list.url from the worktrunk project config (.config/wt.toml, a TOML file read via load_project_config), not from git config. The "no fork" conclusion is still right but the explanation doesn't match the source.
Per worktrunk-bot review feedback on #2883. Fork #3 (`Repository::all_config`'s `git config --list -z` from `git_common_dir`) does NOT fire on the steady-state path for normal repos: `Repository::at` consumes `GIT_CONFIG_PRELOAD` into `cache.all_config` directly. It only re-forks when `prewarm_git_config` declined the preload because `extensions.worktreeConfig=true`. The headline is now "five forks (six in `extensions.worktreeConfig` repos)", the #3 row is tagged **Conditional** with the regime spelled out, and the picker pointer is updated to match. `Repository::url_template` reads `.config/wt.toml` (TOML, via `ProjectConfig::load`), not git config. Moved from the config-lookup "looks like a fork but isn't" list into the "Non-git work on the path" section with the correct explanation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Consolidates the spec for what runs before the
wt switch/wt listskeleton appears, since the previous "Fixed Command Count" table mixed logical fetches with actual forks (most of the listed commands are now cache hits served from the prewarmed in-memory config map) and didn't break down thegit log --no-walkbatch.Two doc-only edits, no behavior change:
commands/list/collect/mod.rs— replaced### Fixed Command Countwith### Forks on the Critical Path: five git forks on the path to the skeleton for a normal repo (six in repos withextensions.worktreeConfig=true, whereRepository::all_configre-forks fromgit_common_dirbecause--listfrom a linked worktree misses main-worktreeconfig.worktreeoverrides). Each row carries its source method and role; Re-enable shell wrapper tests with correct fish snapshots #3 is explicitly tagged Conditional with the regime spelled out. A "looks like a fork but isn't" list enumerates theconfig_lastlookups served from the in-memory map. A callout flagsdefault_branch()'s one-per-repogit ls-remotefallback (worktrunk's one accepted wire-path exception per CLAUDE.md → "Network Access"). A new### #6 — the batched commit-details forksubsection breaks downgit log --no-walk --no-show-signature --format=%H%x00%h%x00%ct%x00%sfield by field: which downstream cell each format field feeds, why each flag is there, the ARG_MAX bound on argv length.commands/picker/mod.rs— a one-sentence pointer onto the existing "Time-to-skeleton" line directing readers to the new collect section.Verified locally with
RUSTDOCFLAGS='-Dwarnings' cargo doc --no-deps --document-private-items(intra-doc links toRepository::prewarm,at,all_config,list_worktrees,local_branches,url_template,is_bare,default_branchall resolve).🤖 Generated with Claude Code