Skip to content

docs(list): document pre-skeleton fork inventory - #2883

Merged
max-sixty merged 2 commits into
mainfrom
picker-lag
May 23, 2026
Merged

docs(list): document pre-skeleton fork inventory#2883
max-sixty merged 2 commits into
mainfrom
picker-lag

Conversation

@max-sixty

@max-sixty max-sixty commented May 23, 2026

Copy link
Copy Markdown
Owner

Consolidates the spec for what runs before the wt switch / wt list skeleton 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 the git log --no-walk batch.

Two doc-only edits, no behavior change:

  • commands/list/collect/mod.rs — replaced ### Fixed Command Count with ### Forks on the Critical Path: five git forks on the path to the skeleton for a normal repo (six in repos with extensions.worktreeConfig=true, where Repository::all_config re-forks from git_common_dir because --list from a linked worktree misses main-worktree config.worktree overrides). 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 the config_last lookups served from the in-memory map. A callout flags default_branch()'s one-per-repo git ls-remote fallback (worktrunk's one accepted wire-path exception per CLAUDE.md → "Network Access"). 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: 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 to Repository::prewarm, at, all_config, list_worktrees, local_branches, url_template, is_bare, default_branch all resolve).

🤖 Generated with Claude Code

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 worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/commands/list/collect/mod.rs Outdated
Comment thread src/commands/list/collect/mod.rs Outdated
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>
@max-sixty
max-sixty merged commit 8668b4c into main May 23, 2026
39 of 40 checks passed
@max-sixty
max-sixty deleted the picker-lag branch May 23, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants