Repository navigation
fix(hooks): honor exclude_commands for head/tail rewrites - #3378
Closed
mohammedelkarsh wants to merge 1 commit into
Closed
mohammedelkarsh wants to merge 1 commit into
mohammedelkarsh wants to merge 1 commit into
Conversation
The head/tail short-circuit skipped the exclude matcher, so listing head/tail in hooks.exclude_commands had no effect unlike cat. Fixes rtk-ai#3371
dev1abz
added a commit
to dev1abz/rtk
that referenced
this pull request
Aug 7, 2026
Collaborator
|
Closing as a duplicate of #3324, which fixes the same gap; #3324 will carry There were seven PRs open against this one fast path. #3324 was picked on shape: it strips the env prefix before matching, so Thanks for the report and the fix — #3371 is what made the cluster findable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
head/tailrewrites now consulthooks.exclude_commandsbefore therewrite_line_rangeshort-circuitexclude_commands = [cat, head, tail]consistent: all three stay unre writtenhead -N,tail -N, andtail -n NFixes #3371
Test plan
cargo test exclude_head_and_tail/head_rewrites_when_not_excludedcargo fmt --all -- --checkcargo clippy --all-targets -- -D warningsrtk hook check 'head -50 big.log'withexclude_commands = [head]printsNo rewrite