Skip to content

docs: add direnv recipe for per-directory categories - #143

Merged
timvw merged 1 commit into
mainfrom
docs/direnv-group-recipe
Aug 20, 2026
Merged

docs: add direnv recipe for per-directory categories#143
timvw merged 1 commit into
mainfrom
docs/direnv-group-recipe

Conversation

@timvw

@timvw timvw commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Documents the per-directory category workaround that works today, as agreed in #138.

Why

docs/configuration.md documents {.env.WT_CATEGORY} as the way to group clones and worktrees, but the only ways to supply the value were per-command (WT_CATEGORY=work wt clone ...) or a single machine-wide export. Neither expresses "everything under this directory is work".

direnv covers that case with no wt changes at all — wt reads the environment. Since #139 landed {.env.X:-default}, a directory without an .envrc degrades to the default instead of hard-erroring, which is what makes the recipe worth recommending rather than merely possible.

What

  • New ### Setting the category per directory subsection in docs/configuration.md, under Clone placement
  • Short pointer to it from the README grouping example

The recipe places an .envrc under both repo_root and worktree_root for a category. That is deliberate: wt clone lands the checkout under repo_root/<cat>/..., and a later wt create from inside it needs the variable still set, or the worktree falls back to personal and the category is lost on the hop between the two trees.

Verification

  • go build ./... && go test ./... — pass (docs-only change, run for the checklist)
  • Confirmed by running it that direnv allow takes a single path, and that direnv exports propagate into nested subdirectories
  • README anchor docs/configuration.md#setting-the-category-per-directory resolves to the new heading

Refs #138

Grouping by WT_CATEGORY is documented as an env var in the pattern, but
the only ways to supply it were per-command or a single machine-wide
export. direnv covers the per-directory case with no wt changes, and the
:- defaults from #139 make it degrade gracefully where no .envrc exists.

Refs #138
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.14%. Comparing base (af50e8c) to head (664a90c).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
+ Coverage   43.06%   43.14%   +0.08%     
==========================================
  Files          34       34              
  Lines        3597     3597              
==========================================
+ Hits         1549     1552       +3     
+ Misses       2048     2045       -3     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timvw
timvw enabled auto-merge (squash) August 20, 2026 09:37
@timvw
timvw merged commit ecd4f2c into main Aug 20, 2026
16 checks passed
@timvw
timvw deleted the docs/direnv-group-recipe branch August 20, 2026 09:40
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.

1 participant