Skip to content

docs(config): name the bare repo's own location in the worktree-path example - #4006

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-33845173583
Sep 4, 2026
Merged

docs(config): name the bare repo's own location in the worktree-path example#4006
max-sixty merged 1 commit into
mainfrom
nightly/clean-33845173583

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Problem

The worktree-path examples in the user-config guide are introduced as being "for repo at ~/code/myproject", and every example states the path it produces. For all but one, that arithmetic checks out. The bare-repository example doesn't:

worktree-path = "{{ repo_path }}/../{{ branch | sanitize }}"

Heading claimed ~/code/myproject/feature-auth. With repo_path at ~/code/myproject as the section says, {{ repo_path }}/../feature-auth resolves to ~/code/feature-auth — one directory up from the stated result.

Fix

The template is right; the heading silently switched the repo's location without saying so. {{ repo_path }} for a bare repo is the bare directory itself (as the variable list a few lines above states), so the claimed result holds only when that directory is a hidden child — the myproject/.git layout that tips-patterns.md documents, and that wt switch's bare-repo offer writes this exact template for. So the heading now names it:

Bare repository cloned to ~/code/myproject/.git (~/code/myproject/feature-auth):

Edited in src/cli/mod.rs (the primary source); the four generated mirrors and two --help snapshots are regenerated output.

Testing

No regression test — this is a documentation string with no behavior attached. The generated mirrors are pinned by the existing sync tests, which is what caught them here:

  • cargo test --test integration readme_sync — 18 passed (regenerates dev/config.example.toml, docs/src/content/docs/config.md, and both skills/.../reference/config.md mirrors).
  • cargo insta test --accept --test integration -- test_help — 47 passed (help_config_create, help_config_long).
  • cargo fmt --check — clean.
  • cargo test --test integration — 2048 passed, 1 failed.
The one integration failure is a sandbox artifact, not a regression

step_copy_ignored::test_copy_ignored_preserves_file_executable_permissions expects 0644 and gets 0664. The tend sandbox runs with umask 0002 (group-writable) rather than the 0022 the test assumes.

Confirmed unrelated: it reproduces identically with this branch's changes stashed, i.e. on the merge base. Both ci and coverage on main are green at 2026-09-03T10:17:26Z. This diff touches only doc strings and snapshot files and cannot reach file-permission code.

Checked against the in-flight docs PRs

#4000, #3999, and #3998 each touch the same five files (src/cli/mod.rs plus the four config mirrors), so I checked for the duplication that sank #4001. None of them edits the worktree-path examples region, and git merge-tree against each reports a clean merge with this branch.

…example

The `worktree-path` examples are introduced as being "for repo at
`~/code/myproject`", and every other example's stated result follows
from that. The bare-repository one didn't: with `repo_path` at
`~/code/myproject`, `{{ repo_path }}/../{{ branch | sanitize }}`
resolves to `~/code/feature-auth`, not the `~/code/myproject/feature-auth`
the heading claimed.

The template is correct; the heading silently assumed a different repo
location. `{{ repo_path }}` for a bare repo is the bare directory itself,
so the stated result holds only when that directory is a hidden child —
the `myproject/.git` layout that tips-patterns.md documents and that
`wt switch`'s bare-repo offer writes this exact template for. Name that
location in the heading.
@worktrunk-bot worktrunk-bot added the nightly-cleanup Issues found by nightly code quality sweep label Sep 4, 2026
@max-sixty
max-sixty merged commit 51fd3b2 into main Sep 4, 2026
37 of 47 checks passed
@max-sixty
max-sixty deleted the nightly/clean-33845173583 branch September 4, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nightly-cleanup Issues found by nightly code quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants