You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Add the ability to show git branch config variables in the list command. #3258
I would like the work tree list command to show various variables that are stored in the git branch config that is associated with the work tree. For example, I store my Jira tickets and state in the git configuration, including a high-level description. It would be nice to be able to get into the list.
Thanks for the suggestion! Most of this already exists today via custom columns (experimental) plus per-branch variables, though with one caveat on where the data lives.
wt list can render arbitrary per-branch values in a column. You define the column in user config and set the values per branch:
[list.custom-columns.Ticket]
template = "{{ vars.ticket }}"# the rendered result is the cell textwidth = 20# optional, default 40priority = 9# optional drop order when the terminal narrows
[list.custom-columns.Note]
template = "{{ vars.note }}"
wt config state vars set ticket PROJ-123
wt config state vars set note "High-level description of this branch"
A column that's empty for every row is dropped automatically, and wt list --format json includes the rendered values under columns. This is the exact use case the feature was built for — tracking what each of many branches is for (Jira ID, state, a free-form description). Docs: custom columns and wt config state vars.
The caveat: these vars are stored under worktrunk's own git-config namespace (worktrunk.state.<branch>.vars.<key>), and the {{ vars.* }} template only reads from that namespace. If your Jira/state data is already in git config under your own keys (e.g. branch.<name>.jira), wt list won't pick those up today — you'd either re-store them via wt config state vars set, or this becomes the genuine gap: a way to surface arbitrary git config keys (not just worktrunk's namespace) in a column.
So the question for prioritization: does setting your values with wt config state vars set cover what you need, or is reading your existing arbitrary git config keys an important part of the ask? That distinction decides whether this is already solved or a real feature gap. A maintainer can weigh in on the latter.
Got it — that confirms it's the real gap, not the already-solved part. You want wt list to read keys you already store yourself under branch.<name>.* in git config (e.g. branch.feature-x.jira), without re-storing them through wt config state vars set. The "same worktree across branches over time" detail is the clincher: keying on the branch's own config is exactly right for that, since the data follows the branch rather than the worktree.
For the record, there's no clean workaround today — custom-column templates only resolve {{ vars.* }}, which reads solely from worktrunk's worktrunk.state.<branch>.vars.* namespace, and an alias can't widen that. So this is a native feature, not an alias.
Roughly what an implementation would add: a second template namespace in the custom-column context that exposes the branch's own git config, e.g.
The open design questions for a maintainer (this part isn't mine to decide):
Scope of exposed keys — only branch.<name>.*, or arbitrary git config? Branch-scoped is the safer, more obviously-useful default and matches your use case.
Namespace name and key access — branch_config.jira vs. something explicit about the branch. prefix, and how to handle keys with dots/dashes in minijinja.
Cost — wt list renders many rows; this should fold into one bulk git config --get-regexp ^branch\. read (like all_vars_entries already does for vars), not a per-row call.
I'll leave the prioritization and the design calls above to a maintainer. Thanks for clarifying — this is a clean, self-contained ask.
Here is an example from my current .git/config file:
[branch "HWINFCI-2810"]description = "[INTERNAL] HWINFCI-2810: Instrument libraries to send telemetry, and initializes telemetry for CLI apps\n\n# Description\nI added instrumentation to a number of python libraries to send usage\ninformation to the default hwinfci otel connector.\n\nI also added the otel connector initialization to the python cli applications.\n\nNote: Currently the default connector is None. See hwinfci-otel on how to setup a connector via env variables.\n\n"shelf = 64645277
nvciShelf = 64694152
review = 202074
jira = HWINFCI-2810
What I do today to extract my data is call
git config branch..
Example:
For the description, my code today uses just the first line. As that line contains a 1 sentence summary. (Ideally, I could say just show me everything from the : onwards. But that is asking alot ) To set the branch description I usually use git branch --edit-description
Both, depending on the key. Git natively defines a small fixed set of branch.<name>.* keys and assigns them meaning; everything else in that namespace (jira, shelf, review, nvciShelf) is pure convention — git stores it but does nothing with it.
The git-native ones (from git help config, verified on git 2.54.0):
branch.<name>.remote, branch.<name>.pushRemote, branch.<name>.merge, branch.<name>.mergeOptions, branch.<name>.rebase — upstream/push tracking, normally written by git branch --set-upstream-to / git push -u.
branch.<name>.description — the one that matters here. It's git-native, edited with git branch --edit-description, and git itself consumes it (auto-added to the format-patch cover letter and request-pull summary). That's exactly the key @cazador481 sets via git branch --edit-description.
There is no git-native "assign a config to a branch" command beyond the generic git config branch.<name>.<key> <value>. Custom keys like jira are set that way and only have meaning to the tooling that reads them — there's no schema and git never validates or uses them.
What this means for the feature: a branch.<name>.* namespace is the right thing to expose, since it's where both git-native (description) and convention keys (jira) already live, and it's stable across git versions. One subtlety worth designing around — description is multi-line by git's own convention (git branch --edit-description opens an editor), and @cazador481's use case wants just the first line. So a column template reading description should probably expose the first line (or offer both), rather than rendering an embedded-newline blob into a table cell.
Verification
git 2.54.0, git help config:
branch.<name>.description
Branch description, can be edited with git branch
--edit-description. Branch description is automatically added to
the format-patch cover letter or request-pull summary.
Confirmed a custom key round-trips with no git-native meaning:
No — what landed in #3073 is template-only. A [list.custom-columns.<Header>] cell is a minijinja template rendered over in-memory data (branch, worktree_path, worktree_name, vars.*); there's no field that shells out per cell. It was deliberately built that way — wt list renders many rows on the time-to-skeleton path, so custom_columns.rs is explicit that expansion runs "zero subprocesses per cell."
So a command-backed column is still unbuilt. There's no ListColumnConfig field for it (src/config/user/sections.rs L145-157, only template/width/priority), and I found no open issue/PR proposing one.
Worth noting it doesn't actually unblock @cazador481's ask. Reading branch.<name>.jira / branch.<name>.description is a local config read, so the right fix there is a branch_config.* template namespace folded into the one bulk git config --get-regexp ^branch\. read (like all_vars_entries already does for vars) — not a per-row subprocess. A general "run a command per cell" feature is a separate, heavier thing: it reintroduces the O(rows) subprocess cost the design avoided, and runs project-config-derived commands, which would have to clear the approval gate. If you want, I can spin up a small design proposal in design/ for the branch_config.* namespace (the cheap, self-contained win) and note command-backed columns as a deliberately-deferred alternative.
Shipped in #3319 (on main now, in the next release).
wt list custom columns can now read a branch's own git config under branch.<name>.* via a new {{ git.branch.* }} template namespace — no wt config state vars set round-trip. It maps straight to git config branch.<name>.<key>, so your existing keys work as-is:
That covers your workflow directly: {{ git.branch.jira }} reads branch.<name>.jira, and {{ git.branch.description | lines | first }} is the first line of the git-native description — the same result as your git config branch.<name>.description | head -n 1. One gotcha: git lowercases config variable names, so branch.<name>.nvciShelf reads as {{ git.branch.nvcishelf }}.
Activity
worktrunk-bot commentedon Jun 26, 2026
Thanks for the suggestion! Most of this already exists today via custom columns (experimental) plus per-branch variables, though with one caveat on where the data lives.
wt listcan render arbitrary per-branch values in a column. You define the column in user config and set the values per branch:A column that's empty for every row is dropped automatically, and
wt list --format jsonincludes the rendered values undercolumns. This is the exact use case the feature was built for — tracking what each of many branches is for (Jira ID, state, a free-form description). Docs: custom columns andwt config state vars.The caveat: these
varsare stored under worktrunk's own git-config namespace (worktrunk.state.<branch>.vars.<key>), and the{{ vars.* }}template only reads from that namespace. If your Jira/state data is already in git config under your own keys (e.g.branch.<name>.jira),wt listwon't pick those up today — you'd either re-store them viawt config state vars set, or this becomes the genuine gap: a way to surface arbitrarygit configkeys (not just worktrunk's namespace) in a column.So the question for prioritization: does setting your values with
wt config state vars setcover what you need, or is reading your existing arbitrarygit configkeys an important part of the ask? That distinction decides whether this is already solved or a real feature gap. A maintainer can weigh in on the latter.Sources
src/cli/mod.rsL1943-1972varsread scope (worktrunk.state.<branch>.vars.*only):src/git/repository/config.rsL142-L156wt config state vars sethandler:src/commands/config/state.rsL1626-L1627cazador481 commentedon Jun 26, 2026
My need is to pull the information from the git branch config. I sometimes use the same worktree when working in multiple branches over time.
worktrunk-bot commentedon Jun 26, 2026
Got it — that confirms it's the real gap, not the already-solved part. You want
wt listto read keys you already store yourself underbranch.<name>.*in git config (e.g.branch.feature-x.jira), without re-storing them throughwt config state vars set. The "same worktree across branches over time" detail is the clincher: keying on the branch's own config is exactly right for that, since the data follows the branch rather than the worktree.For the record, there's no clean workaround today — custom-column templates only resolve
{{ vars.* }}, which reads solely from worktrunk'sworktrunk.state.<branch>.vars.*namespace, and an alias can't widen that. So this is a native feature, not an alias.Roughly what an implementation would add: a second template namespace in the custom-column context that exposes the branch's own git config, e.g.
The open design questions for a maintainer (this part isn't mine to decide):
branch.<name>.*, or arbitrary git config? Branch-scoped is the safer, more obviously-useful default and matches your use case.branch_config.jiravs. something explicit about thebranch.prefix, and how to handle keys with dots/dashes in minijinja.wt listrenders many rows; this should fold into one bulkgit config --get-regexp ^branch\.read (likeall_vars_entriesalready does for vars), not a per-row call.I'll leave the prioritization and the design calls above to a maintainer. Thanks for clarifying — this is a clean, self-contained ask.
max-sixty commentedon Jun 26, 2026
yes, very reasonable suggestion, thanks @cazador481
how are these stored atm in your config? i.e. what would you run to extract them for a specific branch?
cazador481 commentedon Jun 26, 2026
Here is an example from my current .git/config file:
What I do today to extract my data is call
git config branch..
Example:
> git config branch.HWINFCI-8758.jira HWINFCI-8758For the description, my code today uses just the first line. As that line contains a 1 sentence summary. (Ideally, I could say just show me everything from the
:onwards. But that is asking alot ) To set the branch description I usually usegit branch --edit-descriptionmax-sixty commentedon Jun 26, 2026
@worktrunk-bot is there a git-native way of assigning configs to branches? or is the example above just a convention?
worktrunk-bot commentedon Jun 26, 2026
Both, depending on the key. Git natively defines a small fixed set of
branch.<name>.*keys and assigns them meaning; everything else in that namespace (jira, shelf, review, nvciShelf) is pure convention — git stores it but does nothing with it.The git-native ones (from
git help config, verified on git 2.54.0):branch.<name>.remote,branch.<name>.pushRemote,branch.<name>.merge,branch.<name>.mergeOptions,branch.<name>.rebase— upstream/push tracking, normally written bygit branch --set-upstream-to/git push -u.branch.<name>.description— the one that matters here. It's git-native, edited withgit branch --edit-description, and git itself consumes it (auto-added to theformat-patchcover letter andrequest-pullsummary). That's exactly the key @cazador481 sets viagit branch --edit-description.There is no git-native "assign a config to a branch" command beyond the generic
git config branch.<name>.<key> <value>. Custom keys likejiraare set that way and only have meaning to the tooling that reads them — there's no schema and git never validates or uses them.What this means for the feature: a
branch.<name>.*namespace is the right thing to expose, since it's where both git-native (description) and convention keys (jira) already live, and it's stable across git versions. One subtlety worth designing around —descriptionis multi-line by git's own convention (git branch --edit-descriptionopens an editor), and @cazador481's use case wants just the first line. So a column template readingdescriptionshould probably expose the first line (or offer both), rather than rendering an embedded-newline blob into a table cell.Verification
git 2.54.0,
git help config:Confirmed a custom key round-trips with no git-native meaning:
Native
branch.<name>.*keys per the docs:remote,pushRemote,merge,mergeOptions,rebase,description. The rest are convention only.max-sixty commentedon Jun 27, 2026
did we ever land the custom command that could be run for a custom column?
worktrunk-bot commentedon Jun 27, 2026
No — what landed in #3073 is template-only. A
[list.custom-columns.<Header>]cell is a minijinja template rendered over in-memory data (branch,worktree_path,worktree_name,vars.*); there's no field that shells out per cell. It was deliberately built that way —wt listrenders many rows on the time-to-skeleton path, socustom_columns.rsis explicit that expansion runs "zero subprocesses per cell."So a command-backed column is still unbuilt. There's no
ListColumnConfigfield for it (src/config/user/sections.rsL145-157, onlytemplate/width/priority), and I found no open issue/PR proposing one.Worth noting it doesn't actually unblock @cazador481's ask. Reading
branch.<name>.jira/branch.<name>.descriptionis a local config read, so the right fix there is abranch_config.*template namespace folded into the one bulkgit config --get-regexp ^branch\.read (likeall_vars_entriesalready does for vars) — not a per-row subprocess. A general "run a command per cell" feature is a separate, heavier thing: it reintroduces the O(rows) subprocess cost the design avoided, and runs project-config-derived commands, which would have to clear the approval gate. If you want, I can spin up a small design proposal indesign/for thebranch_config.*namespace (the cheap, self-contained win) and note command-backed columns as a deliberately-deferred alternative.max-sixty commentedon Jun 29, 2026
Shipped in #3319 (on
mainnow, in the next release).wt listcustom columns can now read a branch's own git config underbranch.<name>.*via a new{{ git.branch.* }}template namespace — nowt config state vars setround-trip. It maps straight togit config branch.<name>.<key>, so your existing keys work as-is:That covers your workflow directly:
{{ git.branch.jira }}readsbranch.<name>.jira, and{{ git.branch.description | lines | first }}is the first line of the git-native description — the same result as yourgit config branch.<name>.description | head -n 1. One gotcha: git lowercases config variable names, sobranch.<name>.nvciShelfreads as{{ git.branch.nvcishelf }}.A column that's empty on every row is dropped automatically, and
wt list --format jsonincludes the rendered values undercolumns. Docs: https://worktrunk.dev/config/#custom-columnsThanks for the clear request, @cazador481.
feat(list): add git.branch.* template namespace for custom columns (m…