docs(config): name the bare repo's own location in the worktree-path example - #4006
Merged
Conversation
…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.
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.
Problem
The
worktree-pathexamples 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:Heading claimed
~/code/myproject/feature-auth. Withrepo_pathat~/code/myprojectas the section says,{{ repo_path }}/../feature-authresolves 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 — themyproject/.gitlayout that tips-patterns.md documents, and thatwt switch's bare-repo offer writes this exact template for. So the heading now names it:Edited in
src/cli/mod.rs(the primary source); the four generated mirrors and two--helpsnapshots 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 (regeneratesdev/config.example.toml,docs/src/content/docs/config.md, and bothskills/.../reference/config.mdmirrors).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_permissionsexpects0644and gets0664. The tend sandbox runs withumask 0002(group-writable) rather than the0022the test assumes.Confirmed unrelated: it reproduces identically with this branch's changes stashed, i.e. on the merge base. Both
ciandcoverageonmainare green at2026-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.rsplus the four config mirrors), so I checked for the duplication that sank #4001. None of them edits theworktree-pathexamples region, andgit merge-treeagainst each reports a clean merge with this branch.