Repository navigation
feat(list): add git.branch.* template namespace for custom columns - #3319
Conversation
Custom columns can read a branch's own git config under branch.<name>.*
via {{ git.branch.* }}, parallel to {{ vars.* }} — e.g.
{{ git.branch.jira }} or {{ git.branch.description | lines | first }} —
without re-storing the values through `wt config state vars set`.
A new top-level `git` namespace keeps room to grow (git.upstream,
git.remote, …) rather than a flat single-purpose name. Data comes from
the in-memory bulk config snapshot (one read, zero subprocess per cell)
through a shared subsection_map_from_snapshot helper that also backs the
existing vars reader. Parsing splits branch.<name>.<key> with
rsplit_once, so dotted/slashed branch names keep their subsection and
git's section-level keys (branch.sort, …) are skipped.
Closes #3258
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
worktrunk-bot
left a comment
There was a problem hiding this comment.
Reviewed the implementation independently — it reads cleanly and I didn't find anything actionable. Nice that subsection_map_from_snapshot factors out the shared parse-and-collect loop instead of copying all_vars_from_snapshot, and parse_branch_config_key's rsplit_once('.') correctly keeps dotted/slashed branch subsections intact while dropping git's section-level keys like branch.sort. No data-loss surface, and the parser/reader/render paths are all covered by tests.
One CI note so the red isn't mistaken for a real signal: the code-coverage job failed at the Install shells (zsh, fish) step (awalsh128/cache-apt-pkgs-action, exit code 3) — a transient apt-package flake, not the change. The Generate coverage report and Upload to codecov.io steps were skipped as a result, so codecov/patch won't post on this commit. A rerun should clear it.
worktrunk 0.64.0
Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`
---
Created with `brew bump-formula-pr`.<details>
<summary>release notes</summary>
<pre>## Release Notes
### Improved
- **`{{ git.branch.* }}` template namespace for custom columns**: `wt list` custom columns can now read a branch's own git config via `{{ git.branch.<key> }}` — both convention keys you set yourself (`branch.<name>.jira`) and the git-native `branch.<name>.description` — without re-storing the values through `wt config state vars set`. It complements `{{ vars.* }}`, which reads only worktrunk's own state namespace. ([#3319](max-sixty/worktrunk#3319), thanks @cazador481 for the request)
- **Faster warm-cache `wt list` re-runs**: A repeat `wt list` (with `.git/wt/cache/` already populated) is ~36% faster, by removing redundant per-row git subprocesses — priming the commit→tree cache from the `%ct` batch already issued, persisting merge-base results to a content-addressed on-disk cache, and seeding worktree roots and git-dirs from the single `git worktree list` instead of re-forking `git rev-parse` per worktree. ([#3334](max-sixty/worktrunk#3334))
### Fixed
- **Refs that look like flags can't inject git options**: `wt`'s `git diff` previews and diffstats (picker diff previews, `show_diffstat`, push diffstat) now fence user-controlled refs behind `--end-of-options`, and branch removal (`git branch -D`) passes them after `--`, so a branch literally named like a flag (`-x`, `--foo`) reaches git as a positional ref instead of being misparsed as an option. ([#3317](max-sixty/worktrunk#3317))
- **Statusline renders untruncated when `COLUMNS=0`**: `wt list statusline` treated `COLUMNS=0` as a zero-width budget and dropped every segment, rendering an empty line. A zero or unparsable `COLUMNS` is now treated as no detectable width, so the line renders everything untruncated — as the statusline sizing already documented for a missing width. ([#3318](max-sixty/worktrunk#3318))
- **Watchdog "still waiting" line uses the hint symbol**: The transient `Waiting for the commit message (Ns)` line shown during a slow `wt step commit` LLM call now uses the hint prefix (`↳`) instead of the info symbol (`○`), matching the convention for fully-dim status lines. ([#3330](max-sixty/worktrunk#3330))
## Install worktrunk 0.64.0
### Install prebuilt binaries via shell script
```sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-installer.sh | sh && wt config shell install
```
### Install prebuilt binaries via powershell script
```sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-installer.ps1 | iex"; git-wt config shell install
```
### Install prebuilt binaries via Homebrew
```sh
brew install worktrunk && wt config shell install
```
## Download worktrunk 0.64.0
| File | Platform | Checksum |
|--------|----------|----------|
| [worktrunk-aarch64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-aarch64-apple-darwin.tar.xz) | Apple Silicon macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-aarch64-apple-darwin.tar.xz.sha256) |
| [worktrunk-x86_64-apple-darwin.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-x86_64-apple-darwin.tar.xz) | Intel macOS | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-x86_64-apple-darwin.tar.xz.sha256) |
| [worktrunk-x86_64-pc-windows-msvc.zip](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-x86_64-pc-windows-msvc.zip) | x64 Windows | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-x86_64-pc-windows-msvc.zip.sha256) |
| [worktrunk-aarch64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-aarch64-unknown-linux-musl.tar.xz) | ARM64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-aarch64-unknown-linux-musl.tar.xz.sha256) |
| [worktrunk-x86_64-unknown-linux-musl.tar.xz](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-x86_64-unknown-linux-musl.tar.xz) | x64 MUSL Linux | [checksum](https://github.com/max-sixty/worktrunk/releases/download/v0.64.0/worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256) |
### Install via Cargo
```sh
cargo install worktrunk && wt config shell install
```
### Install via Winget (Windows)
```sh
winget install max-sixty.worktrunk && git-wt config shell install
```
### Install via AUR (Arch Linux)
```sh
paru worktrunk-bin && wt config shell install
```
</pre>
<p>View the full release notes at <a href="https://github.com/max-sixty/worktrunk/releases/tag/v0.64.0">https://github.com/max-sixty/worktrunk/releases/tag/v0.64.0</a>.</p>
</details>
<hr>
See merge request: Harmonybrew/homebrew-core!13223
Adds a
{{ git.branch.* }}template namespace forwt listcustom columns, parallel to{{ vars.* }}. It surfaces a branch's own git config underbranch.<name>.*— both convention keys you set yourself (branch.<name>.jira) and the git-nativebranch.<name>.description— without re-storing the values throughwt config state vars set. This is the gap left open in #3258:vars.*only reads worktrunk'sworktrunk.state.<branch>.vars.*namespace, so keys a user already keeps in git config were invisible to the list.Before / after
With
branch.feature.jiraandbranch.feature.descriptionalready in.git/config:Previously the only way to populate these columns was to re-enter the data via
wt config state vars set; now the branch's own config is read directly.Design
gittop-level namespace (rather than a flatbranch_config) so it can grow other git-derived per-branch fields later (git.upstream,git.remote, …) without claiming a new top-level name each time. Today it holdsgit.branch.*.git.branch.<key>maps 1:1 togit config branch.<name>.<key>. Note git lowercases config variable names, sobranch.<name>.nvciShelfreads as{{ git.branch.nvcishelf }}; the git-nativedescriptionis multi-line, so| lines | firstgives the summary line.vars. The reader shares asubsection_map_from_snapshot(parse)helper with the existingall_vars_from_snapshot.branch.<name>.<key>withrsplit_once('.'), which is correct because git variable names can't contain dots: dotted/slashed branch names (feature.foo,feature/bar) keep their full subsection, and git's section-level keys (branch.sort,branch.autoSetupMerge) flatten to two segments and are skipped.Testing
Unit tests for the parser/reader (dotted + slashed branch names, variable-name lowercasing,
branch.sortskip) and for rendering (includingdescription | lines | first); a JSON integration test exercises the fullwt listpath end-to-end. Verified manually against a scratch repo. Full pre-merge gate green (4297 tests, clippy, fmt, rustdoc, docs-in-sync).Closes #3258. Thanks to @cazador481 for the request.