Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat(log): split -vv output into trace.log + output.log, drop -vvv (#2201)

Maximilian Roos3e1b351ac1e8
diff --git a/CLAUDE.md b/CLAUDE.md
index d2561d4a3..70af7aafe 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -260,7 +260,7 @@ Hook output logs are centralized in `.git/wt/logs/` (main worktree's git directo
- **Background hooks**: `{branch}/{source}/{hook-type}/{name}.log` (source: `user` or `project`)
- **Background removal**: `{branch}/internal/remove.log`
-Top-level *files* are shared logs (`commands.jsonl*`, `verbose.log`, `diagnostic.md`); top-level *directories* are per-branch log trees. Branch and hook names are sanitized via `sanitize_for_filename`: already-safe names pass through unchanged; names with invalid characters have them replaced with `-` and a short collision-avoidance hash appended.
+Top-level *files* are shared logs (`commands.jsonl*`, `trace.log`, `output.log`, `diagnostic.md`); top-level *directories* are per-branch log trees. Branch and hook names are sanitized via `sanitize_for_filename`: already-safe names pass through unchanged; names with invalid characters have them replaced with `-` and a short collision-avoidance hash appended.
## Coverage
diff --git a/docs/content/config.md b/docs/content/config.md
index a393358a3..6eccf8fd8 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -492,8 +492,8 @@ Usage: <b><span class=c>wt config</span></b> <span class=c>[OPTIONS]</span> <spa
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
# Subcommands
@@ -550,8 +550,8 @@ Usage: <b><span class=c>wt config show</span></b> <span class=c>[OPTIONS]</span>
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt config state
@@ -622,8 +622,8 @@ Usage: <b><span class=c>wt config state</span></b> <span class=c>[OPTIONS]</span
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt config state default-branch
@@ -677,8 +677,8 @@ Usage: <b><span class=c>wt config state default-branch</span></b> <span class=c>
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt config state logs
@@ -721,10 +721,11 @@ All `post-*` hooks (post-start, post-switch, post-commit, post-merge) run in the
| File | Created when |
|------|-------------|
-| `verbose.log` | Running with `-vv` |
+| `trace.log` | Running with `-vv` |
+| `output.log` | Running with `-vv` |
| `diagnostic.md` | Running with `-vv` when warnings occur |
-`verbose.log` is overwritten on each `-vv` run. `diagnostic.md` is a markdown report for pasting into GitHub issues — written only when warnings occur.
+`trace.log` mirrors stderr (commands, `[wt-trace]` records, bounded subprocess previews). `output.log` holds the raw uncapped subprocess stdout/stderr bodies. Both are overwritten on each `-vv` run. `diagnostic.md` is a markdown report for pasting into GitHub issues — written only when warnings occur, and inlines `trace.log` (never `output.log`, which can be multi-MB).
### Location
@@ -778,8 +779,8 @@ Usage: <b><span class=c>wt config state logs</span></b> <span class=c>[OPTIONS]<
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt config state ci-status
@@ -836,8 +837,8 @@ Usage: <b><span class=c>wt config state ci-status</span></b> <span class=c>[OPTI
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt config state marker
@@ -906,8 +907,8 @@ Usage: <b><span class=c>wt config state marker</span></b> <span class=c>[OPTIONS
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt config state vars
@@ -978,8 +979,8 @@ Usage: <b><span class=c>wt config state vars</span></b> <span class=c>[OPTIONS]<
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
<!-- END AUTO-GENERATED from `wt config --help-page` -->
diff --git a/docs/content/faq.md b/docs/content/faq.md
index 984db21ad..1caab8a0c 100644
--- a/docs/content/faq.md
+++ b/docs/content/faq.md
@@ -117,7 +117,8 @@ Worktrunk stores small amounts of cache and log data in the repository's `.git/`
| `.git/wt/cache/{kind}/*.json` | Cached CI status and git command results (merge-tree, integration probes, diff stats, ancestry checks) | `wt list`, `wt merge`, `wt remove` |
| `.git/wt/logs/{branch}/**/*.log` | Background hook output (nested per branch) | Hooks, background `wt remove` |
| `.git/wt/logs/commands.jsonl` | Command audit log (~2MB max) | Hooks, LLM commands |
-| `.git/wt/logs/verbose.log` | Debug log for issue reporting | Running with `-vv` |
+| `.git/wt/logs/trace.log` | Debug log (mirrors stderr) for issue reporting | Running with `-vv` |
+| `.git/wt/logs/output.log` | Raw uncapped subprocess stdout/stderr (may be multi-MB) | Running with `-vv` |
| `.git/wt/logs/diagnostic.md` | Diagnostic report for issue reporting | Running with `-vv` when warnings occur |
| `.git/wt/trash/<name>-<timestamp>` | Staged worktree contents pending background deletion | `wt remove` |
diff --git a/docs/content/hook.md b/docs/content/hook.md
index 5ab5fc5ec..4f305974c 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -514,8 +514,8 @@ Usage: <b><span class=c>wt hook</span></b> <span class=c>[OPTIONS]</span> <span
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
# Subcommands
@@ -564,8 +564,8 @@ Usage: <b><span class=c>wt hook approvals</span></b> <span class=c>[OPTIONS]</sp
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
<!-- END AUTO-GENERATED from `wt hook --help-page` -->
diff --git a/docs/content/list.md b/docs/content/list.md
index 63ed53344..60070d091 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -281,8 +281,8 @@ Usage: <b><span class=c>wt list</span></b> <span class=c>[OPTIONS]</span>
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
<!-- END AUTO-GENERATED from `wt list --help-page` -->
diff --git a/docs/content/merge.md b/docs/content/merge.md
index 711251956..840ef5ac2 100644
--- a/docs/content/merge.md
+++ b/docs/content/merge.md
@@ -151,8 +151,8 @@ Usage: <b><span class=c>wt merge</span></b> <span class=c>[OPTIONS]</span> <span
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
<!-- END AUTO-GENERATED from `wt merge --help-page` -->
diff --git a/docs/content/remove.md b/docs/content/remove.md
index a0162e536..80d2689c2 100644
--- a/docs/content/remove.md
+++ b/docs/content/remove.md
@@ -136,8 +136,8 @@ Usage: <b><span class=c>wt remove</span></b> <span class=c>[OPTIONS]</span> <spa
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
<!-- END AUTO-GENERATED from `wt remove --help-page` -->
diff --git a/docs/content/step.md b/docs/content/step.md
index e5a90fecf..50b7ada52 100644
--- a/docs/content/step.md
+++ b/docs/content/step.md
@@ -75,8 +75,8 @@ Usage: <b><span class=c>wt step</span></b> <span class=c>[OPTIONS]</span> <span
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
# Subcommands
@@ -156,8 +156,8 @@ Usage: <b><span class=c>wt step commit</span></b> <span class=c>[OPTIONS]</span>
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step squash
@@ -240,8 +240,8 @@ Usage: <b><span class=c>wt step squash</span></b> <span class=c>[OPTIONS]</span>
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step diff
@@ -298,8 +298,8 @@ Usage: <b><span class=c>wt step diff</span></b> <span class=c>[OPTIONS]</span> <
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step copy-ignored
@@ -430,8 +430,8 @@ Usage: <b><span class=c>wt step copy-ignored</span></b> <span class=c>[OPTIONS]<
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step eval
@@ -505,8 +505,8 @@ Usage: <b><span class=c>wt step eval</span></b> <span class=c>[OPTIONS]</span> <
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step for-each
@@ -576,8 +576,8 @@ Usage: <b><span class=c>wt step for-each</span></b> <span class=c>[OPTIONS]</spa
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step promote
@@ -650,8 +650,8 @@ Usage: <b><span class=c>wt step promote</span></b> <span class=c>[OPTIONS]</span
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step prune
@@ -725,8 +725,8 @@ Usage: <b><span class=c>wt step prune</span></b> <span class=c>[OPTIONS]</span>
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## wt step relocate
@@ -815,8 +815,8 @@ Usage: <b><span class=c>wt step relocate</span></b> <span class=c>[OPTIONS]</spa
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
## Aliases
diff --git a/docs/content/switch.md b/docs/content/switch.md
index c0aabe076..7445b8a3c 100644
--- a/docs/content/switch.md
+++ b/docs/content/switch.md
@@ -217,8 +217,8 @@ Usage: <b><span class=c>wt switch</span></b> <span class=c>[OPTIONS]</span> <spa
User config file path
<b><span class=c>-v</span></b>, <b><span class=c>--verbose</span></b><span class=c>...</span>
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
{% end %}
<!-- END AUTO-GENERATED from `wt switch --help-page` -->
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index f16092794..cc3a6c9db 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -495,8 +495,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
# Subcommands
@@ -555,8 +555,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt config state
@@ -641,8 +641,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt config state default-branch
@@ -698,8 +698,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt config state logs
@@ -742,10 +742,11 @@ All `post-*` hooks (post-start, post-switch, post-commit, post-merge) run in the
| File | Created when |
|------|-------------|
-| `verbose.log` | Running with `-vv` |
+| `trace.log` | Running with `-vv` |
+| `output.log` | Running with `-vv` |
| `diagnostic.md` | Running with `-vv` when warnings occur |
-`verbose.log` is overwritten on each `-vv` run. `diagnostic.md` is a markdown report for pasting into GitHub issues — written only when warnings occur.
+`trace.log` mirrors stderr (commands, `[wt-trace]` records, bounded subprocess previews). `output.log` holds the raw uncapped subprocess stdout/stderr bodies. Both are overwritten on each `-vv` run. `diagnostic.md` is a markdown report for pasting into GitHub issues — written only when warnings occur, and inlines `trace.log` (never `output.log`, which can be multi-MB).
### Location
@@ -809,8 +810,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt config state ci-status
@@ -867,8 +868,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt config state marker
@@ -936,8 +937,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt config state vars
@@ -1019,6 +1020,6 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
diff --git a/skills/worktrunk/reference/faq.md b/skills/worktrunk/reference/faq.md
index 128426901..35daa0961 100644
--- a/skills/worktrunk/reference/faq.md
+++ b/skills/worktrunk/reference/faq.md
@@ -110,7 +110,8 @@ Worktrunk stores small amounts of cache and log data in the repository's `.git/`
| `.git/wt/cache/{kind}/*.json` | Cached CI status and git command results (merge-tree, integration probes, diff stats, ancestry checks) | `wt list`, `wt merge`, `wt remove` |
| `.git/wt/logs/{branch}/**/*.log` | Background hook output (nested per branch) | Hooks, background `wt remove` |
| `.git/wt/logs/commands.jsonl` | Command audit log (~2MB max) | Hooks, LLM commands |
-| `.git/wt/logs/verbose.log` | Debug log for issue reporting | Running with `-vv` |
+| `.git/wt/logs/trace.log` | Debug log (mirrors stderr) for issue reporting | Running with `-vv` |
+| `.git/wt/logs/output.log` | Raw uncapped subprocess stdout/stderr (may be multi-MB) | Running with `-vv` |
| `.git/wt/logs/diagnostic.md` | Diagnostic report for issue reporting | Running with `-vv` when warnings occur |
| `.git/wt/trash/<name>-<timestamp>` | Staged worktree contents pending background deletion | `wt remove` |
diff --git a/skills/worktrunk/reference/hook.md b/skills/worktrunk/reference/hook.md
index 0a4bc78d4..ffe061d04 100644
--- a/skills/worktrunk/reference/hook.md
+++ b/skills/worktrunk/reference/hook.md
@@ -507,8 +507,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
# Subcommands
@@ -563,6 +563,6 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
diff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.md
index bd57ea5a6..3d6880a87 100644
--- a/skills/worktrunk/reference/list.md
+++ b/skills/worktrunk/reference/list.md
@@ -311,6 +311,6 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
diff --git a/skills/worktrunk/reference/merge.md b/skills/worktrunk/reference/merge.md
index 6f2d77b27..af4c3ef43 100644
--- a/skills/worktrunk/reference/merge.md
+++ b/skills/worktrunk/reference/merge.md
@@ -141,6 +141,6 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
diff --git a/skills/worktrunk/reference/remove.md b/skills/worktrunk/reference/remove.md
index 8daaae056..6edae7433 100644
--- a/skills/worktrunk/reference/remove.md
+++ b/skills/worktrunk/reference/remove.md
@@ -135,6 +135,6 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
diff --git a/skills/worktrunk/reference/step.md b/skills/worktrunk/reference/step.md
index d75242ea1..2b2b68d2e 100644
--- a/skills/worktrunk/reference/step.md
+++ b/skills/worktrunk/reference/step.md
@@ -68,8 +68,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
# Subcommands
@@ -157,8 +157,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step squash
@@ -245,8 +245,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step diff
@@ -313,8 +313,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step copy-ignored
@@ -445,8 +445,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step eval
@@ -526,8 +526,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step for-each
@@ -605,8 +605,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step promote
@@ -682,8 +682,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step prune
@@ -764,8 +764,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## wt step relocate
@@ -862,8 +862,8 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
## Aliases [experimental]
diff --git a/skills/worktrunk/reference/switch.md b/skills/worktrunk/reference/switch.md
index 5526f9d51..a1203fab0 100644
--- a/skills/worktrunk/reference/switch.md
+++ b/skills/worktrunk/reference/switch.md
@@ -208,6 +208,6 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report;
- -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report
+ + trace.log/output.log under .git/wt/logs/)
```
diff --git a/src/cli/config.rs b/src/cli/config.rs
index b47e3e83d..34d0947f5 100644
--- a/src/cli/config.rs
+++ b/src/cli/config.rs
@@ -641,10 +641,11 @@ All `post-*` hooks (post-start, post-switch, post-commit, post-merge) run in the
| File | Created when |
|------|-------------|
-| `verbose.log` | Running with `-vv` |
+| `trace.log` | Running with `-vv` |
+| `output.log` | Running with `-vv` |
| `diagnostic.md` | Running with `-vv` when warnings occur |
-`verbose.log` is overwritten on each `-vv` run. `diagnostic.md` is a markdown report for pasting into GitHub issues — written only when warnings occur.
+`trace.log` mirrors stderr (commands, `[wt-trace]` records, bounded subprocess previews). `output.log` holds the raw uncapped subprocess stdout/stderr bodies. Both are overwritten on each `-vv` run. `diagnostic.md` is a markdown report for pasting into GitHub issues — written only when warnings occur, and inlines `trace.log` (never `output.log`, which can be multi-MB).
## Location
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 0bc655d19..bdc03e627 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -246,7 +246,7 @@ pub(crate) struct Cli {
)]
pub config: Option<std::path::PathBuf>,
- /// Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ /// Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
#[arg(
long,
short = 'v',
diff --git a/src/commands/config/state.rs b/src/commands/config/state.rs
index 81562c8c7..cfdb65ac6 100644
--- a/src/commands/config/state.rs
+++ b/src/commands/config/state.rs
@@ -6,8 +6,9 @@
//! # Log layout invariant
//!
//! Inside `wt_logs_dir()`, top-level *files* are shared logs (`commands.jsonl*`,
-//! `verbose.log`, `diagnostic.md`) and top-level *directories* are per-branch log
-//! trees (`{branch}/{source|internal}/{hook-type}/{name}.log`). Categorization
+//! `trace.log`, `output.log`, `diagnostic.md`) and top-level *directories* are
+//! per-branch log trees (`{branch}/{source|internal}/{hook-type}/{name}.log`).
+//! Categorization
//! relies on this file-vs-directory distinction: new top-level shared entries
//! must remain files. If a future category needs multiple files, it should live
//! under a single reserved subdirectory rather than adding sibling top-level dirs.
@@ -46,11 +47,11 @@ pub fn require_user_config_path() -> anyhow::Result<PathBuf> {
// ==================== Log Management ====================
-/// Check if a top-level file is a diagnostic file (`verbose.log` or `diagnostic.md`).
-///
-/// These are created by `-vv` and live directly under `wt_logs_dir()`.
+/// Top-level files created by `-vv` under `wt_logs_dir()`.
+const DIAGNOSTIC_FILES: &[&str] = &["trace.log", "output.log", "diagnostic.md"];
+
fn is_diagnostic_file(name: &str) -> bool {
- name == "verbose.log" || name == "diagnostic.md"
+ DIAGNOSTIC_FILES.contains(&name)
}
/// Check if a top-level file belongs to the command audit log (`.jsonl` / `.jsonl.old`).
@@ -180,7 +181,7 @@ fn count_log_files_recursive(dir: &Path) -> anyhow::Result<usize> {
///
/// Walks the two layers of log storage:
///
-/// 1. **Top-level files**: `commands.jsonl*`, `verbose.log`, `diagnostic.md`.
+/// 1. **Top-level files**: `commands.jsonl*`, `trace.log`, `output.log`, `diagnostic.md`.
/// Also sweeps any legacy flat `.log` files left over from the pre-nested
/// layout so the transition is self-healing (no explicit migrator).
/// 2. **Top-level directories**: per-branch log trees — counted recursively
diff --git a/src/commands/process.rs b/src/commands/process.rs
index cecab0f5a..c9f947700 100644
--- a/src/commands/process.rs
+++ b/src/commands/process.rs
@@ -479,7 +479,7 @@ pub fn sweep_stale_trash(repo: &Repository) {
// TODO: the sweep is global (not branch-scoped), but `HookLog::path()`
// always prefixes with a branch segment, so we pass a fake `"wt"` here.
// Cleaner would be a top-level variant resolving to `internal/{op}.log`
- // alongside the other shared logs (`commands.jsonl`, `verbose.log`, etc.).
+ // alongside the other shared logs (`commands.jsonl`, `trace.log`, etc.).
if let Err(e) = spawn_detached(
repo,
&repo.wt_dir(),
diff --git a/src/diagnostic.rs b/src/diagnostic.rs
index 70972946c..fc46c415c 100644
--- a/src/diagnostic.rs
+++ b/src/diagnostic.rs
@@ -24,14 +24,14 @@
//! The report explicitly documents what IS and ISN'T included:
//!
//! **Included:** worktree paths, branch names, worktree status (prunable, locked),
-//! config files, verbose logs, commit messages (in verbose logs)
+//! config files, trace/output logs, commit messages (in trace logs)
//!
//! **Not included:** file contents, credentials
//!
//! # File Location
//!
//! Reports are written to `<git-common-dir>/wt/logs/diagnostic.md` (typically
-//! `.git/wt/logs/diagnostic.md`). Verbose logs go to `verbose.log` in the same directory.
+//! `.git/wt/logs/diagnostic.md`). Companion log files (`trace.log`, `output.log`) live in the same directory.
//!
//! # Usage
//!
@@ -93,16 +93,24 @@ Shell integration: {{ shell_integration }}
```
</details>
{%- endif %}
-{%- if verbose_log %}
+{%- if trace_log %}
<details>
-<summary>Verbose log</summary>
+<summary>Trace log</summary>
```
-{{ verbose_log }}
+{{ trace_log }}
```
</details>
{%- endif %}
+{%- if output_log_path %}
+
+<details>
+<summary>Raw subprocess output</summary>
+
+Full captured stdout/stderr is in `{{ output_log_path }}` — not inlined because it can be multi-MB.
+</details>
+{%- endif %}
"#;
/// Collected diagnostic information for issue reporting.
@@ -147,11 +155,19 @@ impl DiagnosticReport {
// Get config show output (if available)
let config_show = config_show_output(repo);
- // Get verbose log content (if available)
- let verbose_log = crate::verbose_log::log_file_path()
+ // Inline the trace log (bounded; mirrors stderr). The raw subprocess
+ // output log is only *referenced* by path — it can be multi-MB and
+ // would drown out the trace records that matter in a bug report.
+ let trace_log = crate::log_files::TRACE
+ .path()
.and_then(|path| std::fs::read_to_string(&path).ok())
.map(|content| truncate_log(content.trim()))
.filter(|s| !s.is_empty());
+ // Forward slashes on both platforms so the rendered markdown reads the
+ // same in bug reports regardless of where it was produced.
+ let output_log_path = crate::log_files::OUTPUT
+ .path()
+ .map(|p| path_slash::PathExt::to_slash_lossy(p.as_path()).into_owned());
// Render template
let env = Environment::new();
@@ -167,7 +183,8 @@ impl DiagnosticReport {
shell_integration,
worktree_list,
config_show,
- verbose_log,
+ trace_log,
+ output_log_path,
})
.unwrap()
}
@@ -275,7 +292,7 @@ fn strip_ansi_codes(s: &str) -> String {
s.ansi_strip().into_owned()
}
-/// Truncate verbose log to ~50KB if it's too large.
+/// Truncate log content to ~50KB if it's too large.
///
/// Keeps the last ~50KB of the log, cutting at a line boundary.
fn truncate_log(content: &str) -> String {
diff --git a/src/llm.rs b/src/llm.rs
index 4810fb7ec..9ab3c0bef 100644
--- a/src/llm.rs
+++ b/src/llm.rs
@@ -7,7 +7,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use worktrunk::config::CommitGenerationConfig;
use worktrunk::git::Repository;
use worktrunk::path::format_path_for_display;
-use worktrunk::shell_exec::{Cmd, ShellConfig};
+use worktrunk::shell_exec::{Cmd, SUBPROCESS_FULL_TARGET, ShellConfig};
use worktrunk::styling::{eprintln, warning_message};
use minijinja::Environment;
@@ -297,13 +297,11 @@ pub(crate) fn execute_llm_command(command: &str, prompt: &str) -> anyhow::Result
// MB-scale diffs in our process memory and removes them from our logs
// entirely. See conversation around PR #2136 for sketch.
- // Log prompt for debugging (Cmd logs the command itself).
- // One record per line so each is prefixed by env_logger's `[TS LEVEL mod]`
- // header and stays greppable — matches the ` stdout` continuation style
- // used in shell_exec::log_output.
- log::trace!(" Prompt (stdin):");
+ // Log the prompt to output.log alongside captured subprocess stdout —
+ // SUBPROCESS_FULL_TARGET routes to output.log at `-vv`, never to stderr.
+ log::debug!(target: SUBPROCESS_FULL_TARGET, " Prompt (stdin):");
for line in prompt.lines() {
- log::trace!(" {}", line);
+ log::debug!(target: SUBPROCESS_FULL_TARGET, " {}", line);
}
let shell = ShellConfig::get()?;
diff --git a/src/log_files.rs b/src/log_files.rs
new file mode 100644
index 000000000..22d057735
--- /dev/null
+++ b/src/log_files.rs
@@ -0,0 +1,138 @@
+//! On-disk log file sinks and routing for `-vv` debug output.
+//!
+//! At `-vv`, two files are written in the repo's `.git/wt/logs/` directory:
+//!
+//! - [`TRACE`] → `trace.log`: mirrors stderr. Structured records,
+//! `$ cmd [context]` headers, and bounded subprocess previews (same
+//! elision markers the user sees on stderr). High-signal, bounded size —
+//! safe to embed in `diagnostic.md` bug reports.
+//! - [`OUTPUT`] → `output.log`: raw, uncapped subprocess stdout/stderr
+//! bodies captured by `shell_exec::Cmd`. Potentially multi-MB (full
+//! `git log -p` / patch-id output); opt-in for deep dives.
+//!
+//! # Routing
+//!
+//! [`route`] is the single source of truth for which sink a log record
+//! reaches. Invariants:
+//!
+//! - `SUBPROCESS_FULL_TARGET` records never reach stderr — raw bodies
+//! don't flood terminals. They go to `output.log` if active, else
+//! drop. The bounded preview (`SUBPROCESS_TERMINAL_TARGET`) still
+//! reaches stderr, so users always see a capped view.
+//! - `SUBPROCESS_TERMINAL_TARGET` records always reach stderr.
+//! - All other records always reach stderr.
+//! - Stderr records are mirrored to `trace.log` when it's active.
+
+use std::fs::{File, OpenOptions};
+use std::io::Write;
+use std::path::PathBuf;
+use std::sync::{Mutex, OnceLock};
+
+use worktrunk::shell_exec::SUBPROCESS_FULL_TARGET;
+
+pub(crate) struct LogSink {
+ file: OnceLock<Mutex<OpenFile>>,
+ filename: &'static str,
+}
+
+struct OpenFile {
+ path: PathBuf,
+ file: File,
+}
+
+impl LogSink {
+ fn init(&self) {
+ if let Some((path, file)) = try_create(self.filename) {
+ let _ = self.file.set(Mutex::new(OpenFile { path, file }));
+ }
+ }
+
+ /// Whether the file has been successfully created.
+ ///
+ /// Lock-free (`OnceLock::get`); safe for per-record hot-path checks.
+ pub(crate) fn is_active(&self) -> bool {
+ self.file.get().is_some()
+ }
+
+ /// Append a line to the file (no-op if not initialized).
+ ///
+ /// The line should be plain text (no ANSI codes) for readability in bug
+ /// reports. Write errors are swallowed — logging must not break commands.
+ pub(crate) fn write_line(&self, line: &str) {
+ if let Some(mutex) = self.file.get()
+ && let Ok(mut open) = mutex.lock()
+ {
+ let _ = writeln!(open.file, "{}", line);
+ let _ = open.file.flush();
+ }
+ }
+
+ /// Path to the file, if it was created.
+ pub(crate) fn path(&self) -> Option<PathBuf> {
+ self.file
+ .get()
+ .and_then(|mutex| mutex.lock().ok().map(|open| open.path.clone()))
+ }
+}
+
+pub(crate) static TRACE: LogSink = LogSink {
+ file: OnceLock::new(),
+ filename: "trace.log",
+};
+pub(crate) static OUTPUT: LogSink = LogSink {
+ file: OnceLock::new(),
+ filename: "output.log",
+};
+
+/// Initialize both log sinks.
+///
+/// Called once early in `main` when `-vv` or finer is active. Outside a git
+/// repo both sinks stay inactive and all writes become no-ops.
+pub(crate) fn init() {
+ TRACE.init();
+ OUTPUT.init();
+ // Let shell_exec phrase the elision marker to match reality — points at
+ // output.log when it exists, else suggests rerunning with -vv.
+ worktrunk::shell_exec::set_output_log_available(OUTPUT.is_active());
+}
+
+/// Sink routing decision for one log record.
+pub(crate) enum Route {
+ /// Append to this sink; skip stderr.
+ File(&'static LogSink),
+ /// Emit to stderr with normal formatting. Callers also mirror the line
+ /// to [`TRACE`] (no-op when inactive).
+ Stderr,
+ /// Drop the record entirely.
+ Drop,
+}
+
+/// Decide where a log record goes based on its target.
+///
+/// See module docs for the invariants each variant upholds.
+pub(crate) fn route(target: &str) -> Route {
+ if target == SUBPROCESS_FULL_TARGET {
+ if OUTPUT.is_active() {
+ Route::File(&OUTPUT)
+ } else {
+ Route::Drop
+ }
+ } else {
+ // `SUBPROCESS_TERMINAL_TARGET` and all other targets share this path.
+ Route::Stderr
+ }
+}
+
+fn try_create(filename: &str) -> Option<(PathBuf, File)> {
+ let repo = worktrunk::git::Repository::current().ok()?;
+ let log_dir = repo.wt_logs_dir();
+ std::fs::create_dir_all(&log_dir).ok()?;
+ let path = log_dir.join(filename);
+ let file = OpenOptions::new()
+ .write(true)
+ .create(true)
+ .truncate(true)
+ .open(&path)
+ .ok()?;
+ Some((path, file))
+}
diff --git a/src/main.rs b/src/main.rs
index c0d2e1861..c8c89e3fc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,11 +28,11 @@ mod help;
pub(crate) mod help_pager;
mod invocation;
mod llm;
+mod log_files;
mod md_help;
mod output;
mod pager;
mod summary;
-mod verbose_log;
// Re-export invocation utilities at crate level for use by other modules
pub(crate) use invocation::{
@@ -1034,10 +1034,12 @@ fn thread_label() -> char {
fn init_logging(verbose_level: u8) {
// Configure logging based on --verbose flag or RUST_LOG env var.
- // Level map: -v → Info, -vv → Debug, -vvv+ → Trace. `.git/wt/logs/verbose.log`
- // mirrors stderr once we're at Debug or finer — Info records stay on stderr.
+ // Level map: -v → Info, -vv+ → Debug (stderr, with subprocess output
+ // capped). At -vv, `.git/wt/logs/trace.log` mirrors stderr and
+ // `.git/wt/logs/output.log` receives the uncapped subprocess bodies
+ // routed via `shell_exec::SUBPROCESS_FULL_TARGET`.
if verbose_level >= 2 {
- verbose_log::init();
+ log_files::init();
}
// Set global verbosity level for styled verbose output
@@ -1050,25 +1052,31 @@ fn init_logging(verbose_level: u8) {
b.filter_level(log::LevelFilter::Info);
b
}
- 2 => {
- let mut b = env_logger::Builder::new();
- b.filter_level(log::LevelFilter::Debug);
- b
- }
_ => {
let mut b = env_logger::Builder::new();
- b.filter_level(log::LevelFilter::Trace);
+ b.filter_level(log::LevelFilter::Debug);
b
}
};
builder
.format(|buf, record| {
- let msg = record.args().to_string();
+ let route = log_files::route(record.target());
+ if matches!(route, log_files::Route::Drop) {
+ return Ok(());
+ }
+
let thread_num = thread_label();
+ let msg = record.args().to_string();
+ let file_line = format!("[{thread_num}] {msg}");
- // Write plain text to log file (no ANSI codes)
- verbose_log::write_line(&format!("[{thread_num}] {msg}"));
+ if let log_files::Route::File(sink) = route {
+ sink.write_line(&file_line);
+ return Ok(());
+ }
+ // Route::Stderr: mirror to trace.log (no-op when inactive), then
+ // write the ANSI-formatted version to stderr below.
+ log_files::TRACE.write_line(&file_line);
// Commands start with $, make only the command bold (not $ or [worktree])
if let Some(rest) = msg.strip_prefix("$ ") {
diff --git a/src/shell_exec.rs b/src/shell_exec.rs
index a1f891c56..74d9a9722 100644
--- a/src/shell_exec.rs
+++ b/src/shell_exec.rs
@@ -333,37 +333,67 @@ pub fn trace_instant(event: &str) {
crate::trace::emit::instant(event);
}
-/// Maximum lines of captured stdout/stderr emitted per stream at `log::debug!`.
-/// Exceeded content is elided with a `… (N more lines, M bytes elided)` marker.
-/// Raise the level to `log::trace!` (via `-vvv` or `RUST_LOG=trace`) for full output.
+/// Maximum lines of captured stdout/stderr emitted to stderr per stream.
+/// Exceeded content is elided with a `… (N more lines, M bytes elided)` marker;
+/// the full output is still written to `output.log` via
+/// [`SUBPROCESS_FULL_TARGET`].
const LOG_OUTPUT_MAX_LINES: usize = 200;
-/// Maximum bytes of captured stdout/stderr emitted per stream at `log::debug!`.
+/// Maximum bytes of captured stdout/stderr emitted to stderr per stream.
/// Applied in addition to [`LOG_OUTPUT_MAX_LINES`].
const LOG_OUTPUT_MAX_BYTES: usize = 64 * 1024;
+/// Log target used for *full* subprocess stdout/stderr. The format closure in
+/// `main.rs` routes records on this target to `output.log` only, so raw
+/// subprocess bodies (diffs, `git log -p`, patch-id pipelines) don't spam
+/// stderr or drown out trace records in `trace.log`.
+pub const SUBPROCESS_FULL_TARGET: &str = "worktrunk::subprocess_full";
+
+/// Log target used for the *bounded* (stderr-safe) preview of subprocess
+/// output. The format closure in `main.rs` routes records on this target to
+/// stderr and mirrors to `trace.log` — the uncapped version is captured via
+/// [`SUBPROCESS_FULL_TARGET`].
+pub const SUBPROCESS_TERMINAL_TARGET: &str = "worktrunk::subprocess_terminal";
+
+/// Whether the full subprocess output is being captured somewhere (e.g.
+/// `output.log` at `-vv`). Gates the phrasing of the elision marker so it
+/// doesn't promise a file that wasn't created.
+///
+/// Set by the binary's log-file init; stays `false` under `RUST_LOG=debug`
+/// without `-vv`, where the full records are dropped by design.
+static OUTPUT_LOG_AVAILABLE: std::sync::atomic::AtomicBool =
+ std::sync::atomic::AtomicBool::new(false);
+
+/// Called from the binary once the `output.log` sink has been created.
+pub fn set_output_log_available(yes: bool) {
+ OUTPUT_LOG_AVAILABLE.store(yes, std::sync::atomic::Ordering::Relaxed);
+}
+
/// Log captured stdout/stderr of a finished command.
///
-/// At `log::trace!` (enabled by `-vvv`) the full output is emitted, one line
-/// per record with indent prefix (` ` for stdout, ` ! ` for stderr). At
-/// `log::debug!` (`-vv`) the output is capped at [`LOG_OUTPUT_MAX_LINES`] and
-/// [`LOG_OUTPUT_MAX_BYTES`] per stream with an elision marker, so large
-/// subprocess bodies (diffs, prompts) don't flood the verbose stream.
+/// At `log::debug!` (`-vv`) each stream is emitted twice via separate log
+/// targets, and the format closure in `main.rs` routes them:
+/// - [`SUBPROCESS_FULL_TARGET`]: uncapped, line-per-record, `output.log` only.
+/// - [`SUBPROCESS_TERMINAL_TARGET`]: capped at [`LOG_OUTPUT_MAX_LINES`] and
+/// [`LOG_OUTPUT_MAX_BYTES`] per stream with an elision marker, stderr +
+/// `trace.log`.
+///
+/// Below `log::debug!` both targets are disabled and this is a no-op.
fn log_output(output: &std::process::Output) {
- if log::log_enabled!(log::Level::Trace) {
- for line in format_stream_full(&output.stdout, " ") {
- log::trace!("{}", line);
- }
- for line in format_stream_full(&output.stderr, " ! ") {
- log::trace!("{}", line);
- }
- } else if log::log_enabled!(log::Level::Debug) {
- for line in format_stream_bounded(&output.stdout, " ") {
- log::debug!("{}", line);
- }
- for line in format_stream_bounded(&output.stderr, " ! ") {
- log::debug!("{}", line);
- }
+ if !log::log_enabled!(log::Level::Debug) {
+ return;
+ }
+ for line in format_stream_full(&output.stdout, " ") {
+ log::debug!(target: SUBPROCESS_FULL_TARGET, "{}", line);
+ }
+ for line in format_stream_full(&output.stderr, " ! ") {
+ log::debug!(target: SUBPROCESS_FULL_TARGET, "{}", line);
+ }
+ for line in format_stream_bounded(&output.stdout, " ") {
+ log::debug!(target: SUBPROCESS_TERMINAL_TARGET, "{}", line);
+ }
+ for line in format_stream_bounded(&output.stderr, " ! ") {
+ log::debug!(target: SUBPROCESS_TERMINAL_TARGET, "{}", line);
}
}
@@ -380,7 +410,8 @@ fn format_stream_full(bytes: &[u8], prefix: &str) -> Vec<String> {
/// Split captured bytes into prefixed lines with at most [`LOG_OUTPUT_MAX_LINES`]
/// and [`LOG_OUTPUT_MAX_BYTES`] emitted; remainder replaced by a single
-/// `… (N more lines, M bytes elided — use -vvv for full output)` marker.
+/// `… (N more lines, M bytes elided — <hint>)` marker. The hint text tracks
+/// whether `output.log` was opened (see [`set_output_log_available`]).
fn format_stream_bounded(bytes: &[u8], prefix: &str) -> Vec<String> {
if bytes.is_empty() {
return Vec::new();
@@ -395,9 +426,14 @@ fn format_stream_bounded(bytes: &[u8], prefix: &str) -> Vec<String> {
if lines_emitted >= LOG_OUTPUT_MAX_LINES || bytes_emitted >= LOG_OUTPUT_MAX_BYTES {
let remaining_lines = 1 + lines.count();
let remaining_bytes = total_bytes.saturating_sub(bytes_emitted);
+ let hint = if OUTPUT_LOG_AVAILABLE.load(std::sync::atomic::Ordering::Relaxed) {
+ "full output in output.log"
+ } else {
+ "rerun with -vv for full output"
+ };
out.push(format!(
- "{}… ({} more lines, {} bytes elided — use -vvv for full output)",
- prefix, remaining_lines, remaining_bytes
+ "{}… ({} more lines, {} bytes elided — {})",
+ prefix, remaining_lines, remaining_bytes, hint
));
return out;
}
@@ -1742,7 +1778,9 @@ mod tests {
marker.starts_with(" … (5 more lines, "),
"marker should count the 5 lines past the cap: {marker}"
);
- assert!(marker.contains("use -vvv for full output"));
+ // OUTPUT_LOG_AVAILABLE defaults to false (only the binary's
+ // log_files::init sets it true), so the marker here suggests `-vv`.
+ assert!(marker.contains("rerun with -vv"));
}
#[test]
diff --git a/src/trace/emit.rs b/src/trace/emit.rs
index c6b1e06ad..4cd81873f 100644
--- a/src/trace/emit.rs
+++ b/src/trace/emit.rs
@@ -16,9 +16,9 @@
//! ```
//!
//! Records are emitted at `log::debug!`, so `-vv` or `RUST_LOG=debug` makes
-//! them visible. Subprocess stdout/stderr continuations are emitted separately
-//! — full output at `log::trace!` (`-vvv`) and a bounded preview at
-//! `log::debug!` — so raw bodies don't spam `-vv`.
+//! them visible. Subprocess stdout/stderr continuations are emitted via
+//! separate log targets: the full output goes to `output.log`, and a bounded
+//! preview goes to stderr + `trace.log` — so raw bodies don't spam `-vv`.
use std::fmt::Display;
use std::sync::OnceLock;
diff --git a/src/verbose_log.rs b/src/verbose_log.rs
deleted file mode 100644
index 5c29a06df..000000000
--- a/src/verbose_log.rs
+++ /dev/null
@@ -1,88 +0,0 @@
-//! Verbose log file management for diagnostics.
-//!
-//! When `--verbose` is passed, logs are written to both stderr AND
-//! `.git/wt/logs/verbose.log`. This file can be included in diagnostic
-//! reports to help debug issues.
-//!
-//! # Usage
-//!
-//! 1. Call `init()` early in main() after parsing CLI args but before logging
-//! 2. Call `write_line()` from the log format function
-//! 3. The diagnostic module reads the log file via `log_file_path()`
-
-use std::fs::{File, OpenOptions};
-use std::io::Write;
-use std::path::PathBuf;
-use std::sync::{Mutex, OnceLock};
-
-/// Global state for verbose logging to file.
-static VERBOSE_LOG: OnceLock<Mutex<Option<VerboseLog>>> = OnceLock::new();
-
-struct VerboseLog {
- path: PathBuf,
- file: File,
-}
-
-/// Initialize verbose log file writing.
-///
-/// Should be called early in main() when `--verbose` is set.
-/// Tries to find a git repo and create the log file.
-pub(crate) fn init() {
- let mutex = VERBOSE_LOG.get_or_init(|| Mutex::new(None));
- let Ok(mut guard) = mutex.lock() else { return };
-
- // Try to find the repo and create the log file
- if let Some((path, file)) = try_create_log_file() {
- *guard = Some(VerboseLog { path, file });
- }
-}
-
-/// Write a line to the verbose log file (if initialized).
-///
-/// Call this from the log format function. The line should be
-/// plain text (no ANSI codes) for readability in issue reports.
-pub(crate) fn write_line(line: &str) {
- if let Some(mutex) = VERBOSE_LOG.get()
- && let Ok(mut guard) = mutex.lock()
- && let Some(log) = guard.as_mut()
- {
- // Ignore write errors - logging shouldn't break the command
- let _ = writeln!(log.file, "{}", line);
- let _ = log.file.flush();
- }
-}
-
-/// Get the path to the verbose log file, if it was created.
-///
-/// Used by the diagnostic module to include log contents.
-pub(crate) fn log_file_path() -> Option<PathBuf> {
- VERBOSE_LOG.get().and_then(|mutex| {
- mutex
- .lock()
- .ok()
- .and_then(|guard| guard.as_ref().map(|log| log.path.clone()))
- })
-}
-
-/// Try to create the verbose log file in the repo's wt/logs directory.
-///
-fn try_create_log_file() -> Option<(PathBuf, File)> {
- // Find the git repo from current directory
- let repo = worktrunk::git::Repository::current().ok()?;
-
- // Get the wt/logs directory (creates it if needed)
- let log_dir = repo.wt_logs_dir();
- std::fs::create_dir_all(&log_dir).ok()?;
-
- let path = log_dir.join("verbose.log");
-
- // Truncate/create the file
- let file = OpenOptions::new()
- .write(true)
- .create(true)
- .truncate(true)
- .open(&path)
- .ok()?;
-
- Some((path, file))
-}
diff --git a/tests/integration_tests/config_state.rs b/tests/integration_tests/config_state.rs
index 5fc1eb444..672c8e13b 100644
--- a/tests/integration_tests/config_state.rs
+++ b/tests/integration_tests/config_state.rs
@@ -621,7 +621,8 @@ fn test_state_get_logs_diagnostic_files(repo: TestRepo) {
let git_dir = repo.root_path().join(".git");
let log_dir = git_dir.join("wt/logs");
std::fs::create_dir_all(&log_dir).unwrap();
- std::fs::write(log_dir.join("verbose.log"), "debug output").unwrap();
+ std::fs::write(log_dir.join("trace.log"), "debug output").unwrap();
+ std::fs::write(log_dir.join("output.log"), "raw subprocess output").unwrap();
std::fs::write(log_dir.join("diagnostic.md"), "# Diagnostic Report").unwrap();
// Also add a hook output file to verify separation
let remove_rel = internal_log_rel_path("feature", "remove");
@@ -633,14 +634,9 @@ fn test_state_get_logs_diagnostic_files(repo: TestRepo) {
// Diagnostic files appear under DIAGNOSTIC, not HOOK OUTPUT
assert!(stdout.contains("DIAGNOSTIC"), "Expected DIAGNOSTIC heading");
- assert!(
- stdout.contains("verbose.log"),
- "Expected verbose.log in output"
- );
- assert!(
- stdout.contains("diagnostic.md"),
- "Expected diagnostic.md in output"
- );
+ for name in ["trace.log", "output.log", "diagnostic.md"] {
+ assert!(stdout.contains(name), "Expected {name} in output");
+ }
// Hook output should have the remove log but not the diagnostic files
let hook_section = stdout
@@ -655,10 +651,12 @@ fn test_state_get_logs_diagnostic_files(repo: TestRepo) {
hook_section.contains(&remove_display),
"Expected {remove_display} in HOOK OUTPUT: {hook_section}"
);
- assert!(
- !hook_section.contains("verbose.log"),
- "verbose.log should not be in HOOK OUTPUT: {hook_section}"
- );
+ for name in ["trace.log", "output.log"] {
+ assert!(
+ !hook_section.contains(name),
+ "{name} should not be in HOOK OUTPUT: {hook_section}"
+ );
+ }
}
#[rstest]
@@ -667,14 +665,15 @@ fn test_state_clear_logs_includes_diagnostic_files(repo: TestRepo) {
let git_dir = repo.root_path().join(".git");
let log_dir = git_dir.join("wt/logs");
std::fs::create_dir_all(&log_dir).unwrap();
- std::fs::write(log_dir.join("verbose.log"), "debug output").unwrap();
+ std::fs::write(log_dir.join("trace.log"), "debug output").unwrap();
+ std::fs::write(log_dir.join("output.log"), "raw output").unwrap();
std::fs::write(log_dir.join("diagnostic.md"), "# Report").unwrap();
let output = wt_state_cmd(&repo, "logs", "clear", &[]).output().unwrap();
assert!(output.status.success());
assert_snapshot!(
String::from_utf8_lossy(&output.stderr),
- @"✓ Cleared 2 log files"
+ @"✓ Cleared 3 log files"
);
assert!(!log_dir.exists());
}
diff --git a/tests/integration_tests/diagnostic.rs b/tests/integration_tests/diagnostic.rs
index cd5f61476..28f3f1ed9 100644
--- a/tests/integration_tests/diagnostic.rs
+++ b/tests/integration_tests/diagnostic.rs
@@ -67,8 +67,8 @@ fn test_diagnostic_report_file_format(mut repo: TestRepo) {
// Verify verbose log section is present (requires -v or higher)
assert!(
- content.contains("<summary>Verbose log</summary>"),
- "Diagnostic should include verbose log section when run with -vv"
+ content.contains("<summary>Trace log</summary>"),
+ "Diagnostic should include trace log section when run with -vv"
);
let settings = setup_snapshot_settings(&repo);
@@ -183,10 +183,10 @@ fn test_diagnostic_contains_required_sections(mut repo: TestRepo) {
"Should have config section"
);
- // Verbose log section
+ // Trace log section
assert!(
- content.contains("<summary>Verbose log</summary>"),
- "Should have verbose log section"
+ content.contains("<summary>Trace log</summary>"),
+ "Should have trace log section"
);
}
@@ -217,7 +217,7 @@ fn test_diagnostic_context_has_no_ansi_codes(mut repo: TestRepo) {
);
}
-/// Verbose log should contain git command traces for debugging.
+/// Trace log should contain git command traces for debugging.
#[rstest]
fn test_diagnostic_verbose_log_contains_git_commands(mut repo: TestRepo) {
repo.add_worktree("feature");
@@ -233,28 +233,28 @@ fn test_diagnostic_verbose_log_contains_git_commands(mut repo: TestRepo) {
)
.unwrap();
- // Extract verbose log section
+ // Extract trace log section
let verbose_start = content
- .find("<summary>Verbose log</summary>")
- .expect("Should have verbose log");
+ .find("<summary>Trace log</summary>")
+ .expect("Should have trace log");
let verbose_section = &content[verbose_start..];
// Should contain git command traces
assert!(
verbose_section.contains("git worktree list"),
- "Verbose log should contain git worktree list command"
+ "Trace log should contain git worktree list command"
);
assert!(
verbose_section.contains("[wt-trace]"),
- "Verbose log should contain wt-trace entries"
+ "Trace log should contain wt-trace entries"
);
assert!(
verbose_section.contains("dur_us="),
- "Verbose log should contain command durations in microseconds"
+ "Trace log should contain command durations in microseconds"
);
assert!(
verbose_section.contains("ok="),
- "Verbose log should contain success/failure indicators"
+ "Trace log should contain success/failure indicators"
);
}
@@ -302,59 +302,164 @@ fn test_diagnostic_written_to_correct_location(mut repo: TestRepo) {
);
}
-/// Verbose log file should also be created alongside diagnostic.
+/// Both log files (`trace.log` and `output.log`) should be created at `-vv`.
#[rstest]
-fn test_verbose_log_file_created(mut repo: TestRepo) {
+fn test_log_files_created(mut repo: TestRepo) {
repo.add_worktree("feature");
corrupt_worktree_head(&repo, "feature");
repo.wt_command().args(["list", "-vv"]).output().unwrap();
- let verbose_log_path = repo
- .root_path()
- .join(".git")
- .join("wt/logs")
- .join("verbose.log");
+ let logs_dir = repo.root_path().join(".git").join("wt/logs");
+ let trace_log = logs_dir.join("trace.log");
+ let output_log = logs_dir.join("output.log");
+ assert!(trace_log.exists(), "trace.log should be created with -vv");
+ assert!(output_log.exists(), "output.log should be created with -vv");
+
+ let trace = fs::read_to_string(&trace_log).unwrap();
+ assert!(!trace.is_empty(), "trace.log should not be empty");
assert!(
- verbose_log_path.exists(),
- "verbose.log should be created with -vv"
+ trace.contains("[wt-trace]"),
+ "trace.log should contain trace entries"
);
+}
+
+/// At `-vv`, the full (uncapped) subprocess stdout/stderr should land in
+/// `output.log` via `shell_exec::SUBPROCESS_FULL_TARGET` — not in `trace.log`.
+/// `trace.log` gets the bounded preview alongside trace records.
+#[rstest]
+fn test_vv_splits_full_and_bounded_output(repo: TestRepo) {
+ repo.wt_command().args(["list", "-vv"]).output().unwrap();
+
+ let logs_dir = repo.root_path().join(".git").join("wt/logs");
+ let trace = fs::read_to_string(logs_dir.join("trace.log")).unwrap();
+ let output = fs::read_to_string(logs_dir.join("output.log")).unwrap();
- let content = fs::read_to_string(&verbose_log_path).unwrap();
- assert!(!content.is_empty(), "verbose.log should not be empty");
assert!(
- content.contains("[wt-trace]"),
- "verbose.log should contain trace entries"
+ trace.contains("[wt-trace]"),
+ "trace.log should contain [wt-trace] records at -vv"
+ );
+ // Captured stdout is emitted line-by-line with the ` ` / ` ! `
+ // continuation prefix used by log_output. Full subprocess output lives
+ // in output.log.
+ assert!(
+ output.lines().any(|l| l.contains(" worktree ")),
+ "output.log should contain `git worktree list --porcelain` stdout lines at -vv"
+ );
+ // Structured trace records stay in trace.log only, not output.log.
+ assert!(
+ !output.contains("[wt-trace]"),
+ "output.log should not contain [wt-trace] records"
);
}
-/// With `-vvv`, subprocess stdout/stderr should appear in `verbose.log` via
-/// `log::trace!` (not just `[wt-trace]` headers). This guards the Trace
-/// branch of `shell_exec::log_output` and the `-vvv` arm of `init_logging`.
+/// At `-vv`, when a single subprocess produces more than the line cap, stderr
+/// and `trace.log` must show the elision marker while `output.log` holds the
+/// full body without any elision. This guards the bounded-stderr invariant —
+/// a regression that routed full output to stderr would silently fail to
+/// elide.
#[rstest]
-fn test_vvv_emits_subprocess_output_at_trace(repo: TestRepo) {
- repo.wt_command().args(["list", "-vvv"]).output().unwrap();
+fn test_vv_bounded_on_stderr_full_in_output_log(repo: TestRepo) {
+ // `wt list` runs `git for-each-ref refs/heads/` (captured via `Cmd::run`),
+ // so its output flows through `log_output` and exercises the split.
+ // Populate packed-refs with 250 fake branches pointing at HEAD — far more
+ // than LOG_OUTPUT_MAX_LINES (200), which guarantees elision on stderr.
+ let head_out = repo
+ .git_command()
+ .args(["rev-parse", "HEAD"])
+ .run()
+ .unwrap();
+ let head = String::from_utf8(head_out.stdout)
+ .unwrap()
+ .trim()
+ .to_string();
+ let mut content = String::from("# pack-refs with: peeled fully-peeled sorted\n");
+ for i in 0..250 {
+ use std::fmt::Write as _;
+ writeln!(&mut content, "{head} refs/heads/many-branch-{i:03}").unwrap();
+ }
+ std::fs::write(repo.root_path().join(".git/packed-refs"), content).unwrap();
- let verbose_log_path = repo
- .root_path()
- .join(".git")
- .join("wt/logs")
- .join("verbose.log");
+ let output = repo
+ .wt_command()
+ .args(["list", "-vv"])
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("wt list");
+ let stderr = String::from_utf8_lossy(&output.stderr);
+
+ // Elision marker appears on stderr (bounded preview) and in trace.log.
+ let marker = "more lines, ";
assert!(
- verbose_log_path.exists(),
- "verbose.log should be created with -vvv"
+ stderr.contains(marker),
+ "stderr should contain elision marker for >200-line subprocess output: {stderr}"
);
- let content = fs::read_to_string(&verbose_log_path).unwrap();
+ let logs_dir = repo.root_path().join(".git").join("wt/logs");
+ let trace = fs::read_to_string(logs_dir.join("trace.log")).unwrap();
+ let raw = fs::read_to_string(logs_dir.join("output.log")).unwrap();
+
+ assert!(
+ trace.contains(marker),
+ "trace.log mirrors stderr and should include the elision marker"
+ );
assert!(
- content.contains("[wt-trace]"),
- "verbose.log should still contain [wt-trace] records at -vvv"
+ !raw.contains(marker),
+ "output.log holds full output and must not contain an elision marker"
);
- // At Trace, captured stdout/stderr is emitted line-by-line with the
- // ` ` / ` ! ` continuation prefix used by log_output.
+ // The tail refs only appear in the full log.
+ let tail_ref = "many-branch-249";
assert!(
- content.lines().any(|l| l.contains(" worktree ")),
- "verbose.log should contain `git worktree list --porcelain` stdout lines at -vvv"
+ raw.contains(tail_ref),
+ "output.log should contain the full for-each-ref stdout (last ref)"
+ );
+ assert!(
+ !stderr.contains(tail_ref),
+ "stderr preview should be bounded before the last ref"
+ );
+ assert!(
+ !trace.contains(tail_ref),
+ "trace.log mirrors stderr and should be bounded too"
+ );
+}
+
+/// `RUST_LOG=debug` at `-v 0` activates Debug logging without creating the
+/// on-disk log files. Stderr receives the **bounded** preview
+/// (`SUBPROCESS_TERMINAL_TARGET`); the uncapped `SUBPROCESS_FULL_TARGET`
+/// records are dropped so raw bodies don't flood the terminal.
+#[rstest]
+fn test_rust_log_debug_fallback_without_vv(repo: TestRepo) {
+ let output = repo
+ .wt_command()
+ .args(["list"])
+ .env("RUST_LOG", "debug")
+ .env("NO_COLOR", "1")
+ .output()
+ .expect("wt list");
+ let stderr = String::from_utf8_lossy(&output.stderr);
+
+ // No log files were created — `-vv` is what opens them.
+ let logs_dir = repo.root_path().join(".git").join("wt/logs");
+ assert!(
+ !logs_dir.join("trace.log").exists(),
+ "trace.log should NOT be created without -vv"
+ );
+ assert!(
+ !logs_dir.join("output.log").exists(),
+ "output.log should NOT be created without -vv"
+ );
+
+ // Subprocess stdout still reaches stderr via the bounded preview —
+ // look for captured `git worktree list --porcelain` stdout lines.
+ assert!(
+ stderr.lines().any(|l| l.contains(" worktree ")),
+ "stderr should contain subprocess stdout via bounded preview: {stderr}"
+ );
+ // For small outputs (git worktree list --porcelain is a handful of lines)
+ // the bounded preview fits under the cap without an elision marker.
+ assert!(
+ !stderr.contains("more lines, "),
+ "short subprocess output should not trip the elision marker: {stderr}"
);
}
@@ -428,7 +533,7 @@ fn test_vv_writes_diagnostic_on_error(mut repo: TestRepo) {
}
/// With just -v, info-level logging goes to stderr but no log files are written.
-/// `-vv` is the threshold for `verbose.log` and `diagnostic.md`.
+/// `-vv` is the threshold for `trace.log`, `output.log`, and `diagnostic.md`.
#[rstest]
fn test_v_does_not_write_log_files(repo: TestRepo) {
// Run a successful command with just -v
@@ -436,19 +541,14 @@ fn test_v_does_not_write_log_files(repo: TestRepo) {
assert!(output.status.success(), "Command should succeed");
- // Neither diagnostic.md nor verbose.log should exist with just -v
+ // None of the -vv diagnostic files should exist with just -v
let wt_logs = repo.root_path().join(".git").join("wt/logs");
- let diagnostic_path = wt_logs.join("diagnostic.md");
- let verbose_log_path = wt_logs.join("verbose.log");
-
- assert!(
- !diagnostic_path.exists(),
- "Diagnostic file should NOT be created with just -v"
- );
- assert!(
- !verbose_log_path.exists(),
- "verbose.log should NOT be created with just -v (requires -vv)"
- );
+ for name in ["diagnostic.md", "trace.log", "output.log"] {
+ assert!(
+ !wt_logs.join(name).exists(),
+ "{name} should NOT be created with just -v (requires -vv)"
+ );
+ }
}
/// With -vv outside a git repo, command should still work (no crash).
@@ -574,11 +674,13 @@ fn normalize_report(content: &str) -> String {
.replace_all(&result, "Project config: _REPO_/.config/wt.toml")
.to_string();
- // Normalize temp paths in context (repo paths) - handles both Unix and Windows paths
- // Unix: /var/folders/.../repo.xxx or /tmp/.../repo.xxx
- // Windows: D:\a\worktrunk\worktrunk\... or C:\Users\...\repo.xxx
- // Match Windows paths first (drive letter + colon + any path chars)
- result = regex::Regex::new(r"([A-Z]:[^\s)]+|/[^\s)]+/repo\.[^\s)]+)")
+ // Normalize worktree temp paths (paths that contain `/repo.<name>` or
+ // `\repo.<name>` — the convention used by TestRepo for linked worktrees).
+ // Both branches require the `repo.` segment so the main-worktree path
+ // (which is `.../repo` without a dot) falls through to insta's prefix
+ // filter instead. Stop at whitespace, `)`, or a backtick so paths inlined
+ // in markdown code spans don't eat the closing backtick.
+ result = regex::Regex::new(r"([A-Z]:[^\s)`]+[\\/]repo\.[^\s)`]+|/[^\s)`]+/repo\.[^\s)`]+)")
.unwrap()
.replace_all(&result, "[REPO_PATH]")
.to_string();
@@ -591,17 +693,17 @@ fn normalize_report(content: &str) -> String {
.replace_all(&result, "$1 $2")
.to_string();
- // Truncate verbose log section - it has parallel git commands that interleave
+ // Truncate trace log section - it has parallel git commands that interleave
// in different orders, making exact snapshot comparison flaky.
// We verify the section exists separately in the test.
- if let Some(start) = result.find("<summary>Verbose log</summary>") {
+ if let Some(start) = result.find("<summary>Trace log</summary>") {
// Find the closing </details> after this point
if let Some(end_offset) = result[start..].find("</details>") {
let end = start + end_offset + "</details>".len();
let before = &result[..start];
let after = &result[end..];
result = format!(
- "{}<summary>Verbose log</summary>\n\n[VERBOSE_LOG_CONTENT]\n</details>{}",
+ "{}<summary>Trace log</summary>\n\n[TRACE_LOG_CONTENT]\n</details>{}",
before, after
);
}
diff --git a/tests/snapshots/integration__integration_tests__diagnostic__diagnostic_file_format.snap b/tests/snapshots/integration__integration_tests__diagnostic__diagnostic_file_format.snap
index ff74fce66..4d0b7e1e0 100644
--- a/tests/snapshots/integration__integration_tests__diagnostic__diagnostic_file_format.snap
+++ b/tests/snapshots/integration__integration_tests__diagnostic__diagnostic_file_format.snap
@@ -56,7 +56,13 @@ Project config: _REPO_/.config/wt.toml
</details>
<details>
-<summary>Verbose log</summary>
+<summary>Trace log</summary>
-[VERBOSE_LOG_CONTENT]
+[TRACE_LOG_CONTENT]
+</details>
+
+<details>
+<summary>Raw subprocess output</summary>
+
+Full captured stdout/stderr is in `_REPO_/.git/wt/logs/output.log` — not inlined because it can be multi-MB.
</details>
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index f232f521a..0e74e490e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -50,7 +50,7 @@ Usage: wt config create [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
User config
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index 52464affd..dc13d9aa5 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -56,7 +56,7 @@ Usage: wt config [OPTIONS] <COMMAND>
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Examples
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
index adf0fd18d..5912a15e6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_shell.snap
@@ -47,6 +47,6 @@ Usage: wt config shell [OPTIONS] <COMMAND>
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_short.snap b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
index 2a4da7f36..7d1672420 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_short.snap
@@ -48,6 +48,6 @@ Usage: wt config [OPTIONS] <COMMAND>
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_show.snap b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
index d39797ecf..77b04636f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_show.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_show.snap
@@ -60,7 +60,7 @@ Usage: wt config show [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Shows location and contents of user config (~/.config/worktrunk/config.toml)
and project config (.config/wt.toml). Also shows system config if present.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state.snap b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
index 319fd7dc6..8925a1a9e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state.snap
@@ -58,7 +58,7 @@ Usage: wt config state [OPTIONS] <COMMAND>
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
State is stored in .git/ (config entries and log files), separate from configuration files.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
index 7fbd7cbfa..d4f9e9ff5 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_ci_status.snap
@@ -56,7 +56,7 @@ Usage: wt config state ci-status [OPTIONS] [COMMAND]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Caches GitHub/GitLab CI status for display in wt list.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
index 0c5c0f6c4..96ade39d7 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_clear.snap
@@ -48,7 +48,7 @@ Usage: wt config state clear [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Clears all stored state:
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
index cd5090502..7ccd2d3c0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_default_branch.snap
@@ -53,7 +53,7 @@ Usage: wt config state default-branch [OPTIONS] [COMM
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Useful in scripts to avoid hardcoding main or master:
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
index fa5e3777a..d037b62b9 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_get.snap
@@ -53,7 +53,7 @@ Usage: wt config state get [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Shows all stored state including:
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
index 58af6bc32..061ff0b92 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_logs.snap
@@ -56,7 +56,7 @@ Usage: wt config state logs [OPTIONS] [COMMAND]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
View and manage log files — hook output, command audit trail, and debug diagnostics.
@@ -94,10 +94,11 @@ All post-* hooks (post-start, post-switch, post-commit, post-merge) run
File Created when
───────────── ────────────────────────────────────
- verbose.log Running with -vv
+ trace.log Running with -vv
+ output.log Running with -vv
diagnostic.md Running with -vv when warnings occur
-verbose.log is overwritten on each -vv run. diagnostic.md is a markdown report for pasting into GitHub issues — written only when warnings occur.
+trace.log mirrors stderr (commands, [wt-trace] records, bounded subprocess previews). output.log holds the raw uncapped subprocess stdout/stderr bodies. Both are overwritten on each -vv run. diagnostic.md is a markdown report for pasting into GitHub issues — written only when warnings occur, and inlines trace.log (never output.log, which can be multi-MB).
Location
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
index bde2c488a..9ba6b96c0 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_marker.snap
@@ -57,7 +57,7 @@ Usage: wt config state marker [OPTIONS] [COMMAND]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Custom status text or emoji shown in the wt list Status column.
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
index ec378a043..4b1a1f1a3 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_state_previous_branch.snap
@@ -53,7 +53,7 @@ Usage: wt config state previous-branch [OPTIONS] [COM
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Enables wt switch - to return to the previous worktree, similar to cd - or git checkout -.
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
index 375c27821..0c7433151 100644
--- a/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_hook_approvals.snap
@@ -51,7 +51,7 @@ Usage: wt hook approvals [OPTIONS] <COMMAND>
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Project hooks require approval on first run to prevent untrusted projects from running arbitrary commands.
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_approvals_add.snap b/tests/snapshots/integration__integration_tests__help__help_hook_approvals_add.snap
index ed71b2548..2d09b07e7 100644
--- a/tests/snapshots/integration__integration_tests__help__help_hook_approvals_add.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_hook_approvals_add.snap
@@ -51,7 +51,7 @@ Usage: wt hook approvals add [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Prompts for approval of all project commands and saves them to approvals.toml.
diff --git a/tests/snapshots/integration__integration_tests__help__help_hook_approvals_clear.snap b/tests/snapshots/integration__integration_tests__help__help_hook_approvals_clear.snap
index 25770ec9a..114252117 100644
--- a/tests/snapshots/integration__integration_tests__help__help_hook_approvals_clear.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_hook_approvals_clear.snap
@@ -51,7 +51,7 @@ Usage: wt hook approvals clear [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Removes saved approvals, requiring re-approval on next command run.
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index 8c6abbf45..726654e3e 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -69,7 +69,7 @@ Usage: wt list [OPTIONS]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Shows uncommitted changes, divergence from the default branch and remote, and optional CI status and LLM summaries.
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index f692127eb..4f95eb678 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -72,7 +72,7 @@ Usage: wt list [OPTIONS]
-v, --verbose...
Verbose output (-v: info logs + hook/template output; -vv: debug logs
- + diagnostic report; -vvv: trace logs)
+ + diagnostic report + trace.log/output.log under .git/wt/logs/)
Shows uncommitted changes, divergence from the default branch and remote, and
optional CI status and LLM summaries.
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_short.snap b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
index 4e14c9fd1..4aeeed95c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_short.snap
@@ -49,6 +49,6 @@ Usage: wt list [OPTIONS]
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index 46c176565..5c412a7e1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -95,7 +95,7 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Unlike `git merge`, this merges the current branch into the target branch — not the target into current. Similar to clicking "Merge pull request" on GitHub, but locally. The target defaults to the default branch.
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_root.snap b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
index 4c3eb556e..d36becb48 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_root.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_root.snap
@@ -57,7 +57,7 @@ Global Options:
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Getting started
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index 4825ce7b5..c340ad8b1 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -95,7 +95,7 @@ Usage: wt merge [OPTIONS] [TARGET]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Unlike git merge, this merges the current branch into the target branch — not the target into current. Similar to clicking "Merge pull request" on GitHub, but locally. The target defaults to the default branch.
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
index a8c945052..e6f2d349f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_short.snap
@@ -54,6 +54,6 @@ Usage: wt merge [OPTIONS] [TARGET]
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_no_args.snap b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
index 5d1e60c9a..34847d6c6 100644
--- a/tests/snapshots/integration__integration_tests__help__help_no_args.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_no_args.snap
@@ -48,6 +48,6 @@ Usage: wt [OPTIONS] [COMMAND]
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
index 5347c8b66..ee8bbd7cb 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_long.snap
@@ -84,7 +84,7 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Examples
diff --git a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
index 78e45e812..8ef83db44 100644
--- a/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_remove_short.snap
@@ -52,6 +52,6 @@ Usage: wt remove [OPTIONS] [BRANCHES]...
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_long.snap b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
index 4f4bafaf6..97c468992 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_long.snap
@@ -57,7 +57,7 @@ Usage: wt [OPTIONS] [COMMAND]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Getting started
diff --git a/tests/snapshots/integration__integration_tests__help__help_root_short.snap b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
index 3d24eef66..f21d4586a 100644
--- a/tests/snapshots/integration__integration_tests__help__help_root_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_root_short.snap
@@ -49,6 +49,6 @@ Usage: wt [OPTIONS] [COMMAND]
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_long.snap b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
index 9ffe21760..7aa6604ad 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_long.snap
@@ -61,7 +61,7 @@ Usage: wt step [OPTIONS] <COMMAND>
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Examples
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
index 9e74fb05c..bbd1dcf5f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_promote.snap
@@ -55,7 +55,7 @@ Usage: wt step promote [OPTIONS] [BRANCH]
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Experimental. Use promote for temporary testing when the main worktree has special significance (Docker Compose, IDE configs, heavy build artifacts anchored to project root), and hooks & tools aren't yet set up to run on arbitrary worktrees. The idiomatic Worktrunk workflow does not use promote; instead each worktree has a full environment. promote is the only Worktrunk command which changes a branch in an existing worktree.
diff --git a/tests/snapshots/integration__integration_tests__help__help_step_short.snap b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
index cd1d64fe9..8b3b433ee 100644
--- a/tests/snapshots/integration__integration_tests__help__help_step_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_step_short.snap
@@ -53,6 +53,6 @@ Usage: wt step [OPTIONS] <COMMAND>
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 01edf1a55..a9f1319b4 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -116,7 +116,7 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
User config file path
-v, --verbose...
- Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
Worktrees are addressed by branch name; paths are computed from a configurable template. Unlike git switch, this navigates between worktrees rather than changing branches in place.
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
index bf3a6e39e..0b4cf9154 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_short.snap
@@ -58,6 +58,6 @@ Usage: wt switch [OPTIONS] [BRANCH] [--
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
index 06d747474..5b3511a69 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_help_includes_aliases.snap
@@ -68,6 +68,6 @@ Usage: wt step [OPTIONS] <COMMAND>
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap
index 97357a4fa..6ecfe12fe 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_list_no_aliases.snap
@@ -64,6 +64,6 @@ Usage: wt step [OPTIONS] <COMMAND>
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap b/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
index 31b122988..bdb14cb34 100644
--- a/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
+++ b/tests/snapshots/integration__integration_tests__step_alias__step_list_with_aliases.snap
@@ -69,6 +69,6 @@ Usage: wt step [OPTIONS] <COMMAND>
Global Options:
-C <path> Working directory for this command
--config <path> User config file path
- -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report; -vvv: trace logs)
+ -v, --verbose... Verbose output (-v: info logs + hook/template output; -vv: debug logs + diagnostic report + trace.log/output.log under .git/wt/logs/)
----- stderr -----