Kieran's opinionated (and probably slightly dumb) nix config
1# wut
2
3**W**orktrees **U**nexpectedly **T**olerable — a git worktree manager that keeps worktrees organized under `.worktrees/`.
4
5## Options
6
7| Option | Type | Default | Description |
8|--------|------|---------|-------------|
9| `atelier.shell.wut.enable` | bool | `false` | Install wut and the zsh shell wrapper |
10
11## Usage
12
13```bash
14wut new feat/my-feature # Create worktree + branch under .worktrees/
15wut list # Show all worktrees
16wut go feat/my-feature # cd into worktree (via shell wrapper)
17wut go # Interactive picker
18wut path feat/my-feature # Print worktree path
19wut rm feat/my-feature # Remove worktree + delete branch
20```
21
22## Shell integration
23
24Wut needs to `cd` the calling shell, which a subprocess can't do directly. It works by printing a `__WUT_CD__=/path` marker that a zsh wrapper function intercepts:
25
26```zsh
27wut() {
28 output=$(/path/to/wut "$@")
29 if [[ "$output" == *"__WUT_CD__="* ]]; then
30 cd "${output##*__WUT_CD__=}"
31 else
32 echo "$output"
33 fi
34}
35```
36
37This wrapper is automatically injected into `initContent` when the module is enabled.
38
39## Safety
40
41- `wut rm` refuses to delete worktrees with uncommitted changes (use `--force` to override)
42- `wut rm` warns before deleting unmerged branches
43- The main/master branch worktree cannot be removed