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
hooks.exclude_commands does not apply to head/tail rewrites #2363
In src/discover/registry.rs (develop), rewrite_segment_inner short-circuits head - / tail to rewrite_line_range() (around line 786) before the classify path reaches is_excluded() (around line 805). The short-circuit never consults the exclusion list.
Why it matters
rtk read --max-lines N returns a condensed view with elision markers rather than the verbatim first N lines:
$ head -3 package.json{}[30 more lines]
That is the right trade for most output, but users who want verbatim head behavior reach for exclude_commands, the documented opt-out, and it silently does nothing for these commands.
Expected
exclude_commands applies to every rewrite path, including the head/tail short-circuit.
exclude_commands config is silently ignored for head/tail rewrites due to early short-circuit before the exclusion check in rewrite_segment_inner; fix by moving the is_excluded() guard before the head/tail branch.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/discover/registry.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
pszymkowiak commentedon Jun 10, 2026
🔍 Automated Triage
bugmediumSummary
exclude_commands config is silently ignored for head/tail rewrites due to early short-circuit before the exclusion check in rewrite_segment_inner; fix by moving the is_excluded() guard before the head/tail branch.
📁 Relevant files
src/discover/registry.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
hgunduzoglu commentedon Jun 11, 2026
I'm taking this one — will follow up with a PR shortly.