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 silently ignored for head/tail rewrites (honored for cat) #3371
With head and tail listed in [hooks] exclude_commands, the hook engine still rewrites head -N / tail -N to rtk read. The same list entry works for cat (and for ls, find, git diff, docker logs). No warning is emitted — the binary contains warning: invalid exclude_commands pattern / ignoring trivial exclude_commands pattern strings, but nothing is printed for head/tail.
Also tried as list entries: "read", "rtk read", "head *", "head -50" — none suppress the rewrite.
Expected
Either head/tail in exclude_commands suppresses the rewrite (consistent with cat), or a startup/stderr warning states the pattern is unsupported. Silent partial application makes the config untrustworthy — the operator believes the exclusion is active when it is not.
Why we needed this
We wanted to opt out of the head rewrite because of the --max-lines halving bug (filed separately) while keeping the rest of the hook active. Currently the only workaround is that the head -n N spelling happens not to be rewritten — which is itself an inconsistency (head -N rewritten, head -n N not; tail -n N rewritten).
exclude_commands config entry works for cat/ls/find/git diff/docker logs but is silently ignored for head/tail rewrites, with no warning printed despite such warnings existing in the binary — fix the exclude matcher to cover head/tail or emit the unsupported-pattern warning.
Triaged automatically by wshm · This is an automated analysis, not a human review.
I'd like to work on this. Fixing [hooks] exclude_commands so head/tail rewrites honor the exclude list (or warn if unsupported), with a regression test.
Activity
joymin5655 commentedon Aug 3, 2026
The
--max-lineshalving bug referenced above is filed as #3370.pszymkowiak commentedon Aug 3, 2026
🔍 Automated Triage
bugmediumSummary
exclude_commands config entry works for cat/ls/find/git diff/docker logs but is silently ignored for head/tail rewrites, with no warning printed despite such warnings existing in the binary — fix the exclude matcher to cover head/tail or emit the unsupported-pattern warning.
Triaged automatically by wshm · This is an automated analysis, not a human review.
mohammedelkarsh commentedon Aug 3, 2026
I'd like to work on this. Fixing
[hooks] exclude_commandsso head/tail rewrites honor the exclude list (or warn if unsupported), with a regression test.docs(hook): drop the obsolete head/tail exclude_commands caveat
chore: land 8 approved PRs as one rollup (#246)