fix: strip trailing stderr redirects before rewrite matching (#530)#797
Merged
pszymkowiak merged 1 commit intodevelopfrom Mar 24, 2026
Merged
fix: strip trailing stderr redirects before rewrite matching (#530)#797pszymkowiak merged 1 commit intodevelopfrom
pszymkowiak merged 1 commit intodevelopfrom
Conversation
Collaborator
Author
📊 Automated PR Analysis
SummaryFixes a bug where trailing stderr/stdout redirects (e.g., Review Checklist
Linked issues: #530 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
22b062b to
084f18e
Compare
Commands like `git status 2>&1` or `cargo test 2>/dev/null` were not rewritten because the redirect suffix prevented pattern matching. Now strips redirects (2>&1, 2>/dev/null, etc.) before matching, then re-appends them to the rewritten command. Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
084f18e to
36a6f48
Compare
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.
Closes #530
Problem
rtk rewrite "git status 2>&1"returned nothing because2>&1was part of the string passed to pattern matching.Fix
Strip trailing redirects (
2>&1,2>/dev/null, etc.) before matching, re-append after rewrite.Test plan
rtk rewriteon all redirect patterns