`rtk git branch -vv` strips commit hashes, tracking markers, and remote metadata — filter has no `-vv` awareness
#1499 opened on Apr 24, 2026
Description
rtk git branch -vv drops commit hashes, the [origin/...] upstream tracking marker, and commit subjects — the very information -vv exists to show. filter_branch_output is designed around bare git branch -a output and has no handling for the verbose format, so metadata the user explicitly requested is silently discarded.
Reproduction
$ RTK_DISABLED=1 git branch -vv
feature-a abc12345 Some commit subject
feature-b def67890 Another commit subject
* main 12345678 [origin/main] Latest commit on main
$ rtk git branch -vv
* main
feature-a
feature-b
remote-only (3):
topic-x
agent/topic-y-abc123
topic-z
The upstream marker [origin/main], the commit hashes, and the subjects are gone. From the agent's point of view, git branch -vv is indistinguishable from git branch -a — the flag had no effect.
Cause
-vv isn't in the list-flag set at run_branch, so the command falls through to List mode:
List mode adds -a --no-color, passes -vv through to git, then pipes the result through filter_branch_output:
filter_branch_output was designed for bare git branch -a output (see the test fixtures at lines 1885-1925 — none use -vv format) and reshapes everything into the compact * current + locals + remote-only block shown above. There's no code path that preserves [origin/...] markers or hash + subject when -vv is present:
Impact
-vv is the canonical way to check upstream tracking state — "does my local branch have an upstream? is it ahead/behind?". When RTK answers the agent's git branch -vv with bare names, the agent has no way to see tracking configuration and may conclude branches have no upstream when they do. RTK_DISABLED=1 git branch -vv works as a workaround, but as with #1474 and #730, the agent only reaches for it once something else tips it off that the output is incomplete.
Suggestion
The project's own design philosophy covers this case:
When a user or LLM explicitly requests detailed output via flags (e.g.,
git log --comments,cargo test -- --nocapture,ls -la), respect that intent. Compressing explicitly-requested detail defeats the purpose.
-v / -vv / --verbose fit that rule exactly. One option is to detect those flags in run_branch and passthrough raw. Another is to make filter_branch_output aware of the verbose format and preserve the hash + tracking marker + subject per line. Passthrough is simpler and matches the principle more literally.
Broader Pattern
Same class of bug as #1474, #730, #720 — a filter that isn't flag-aware silently strips content the user asked for, and the hook makes the loss invisible to the agent.
Related
- #1474 —
gh pr comment --helpoutputs cannedok commented(same class: flag ignored) - #730 —
gh pr diff --name-onlyreturns empty (same class: filter applied to non-matching data) - #720 —
--commentssilently dropped ongh issue/pr view(same class: flag ignored)
Environment
- rtk 0.37.2
- Windows 11 (Git Bash)