grep / rg / git-diff reliability sweep
This release closes a 9-report sweep of rtk's command-proxy layer — the part that runs
grep as rg, regroups search output, and compacts git diff. A filtering proxy is only
useful if its output is faithful; these were the cases where it wasn't.
The shape of the bugs
| Reports | 9 (5 High · 4 Medium) |
| By mechanism | 5 output-mangling · 3 input-rewrite · 1 crash |
| Failure mode | 8 of 9 exited 0 with wrong/misleading output — only the EACCES case crashed loudly |
| Epicenter | proxying grep↔rg: one tool executed as the other, so flag meanings, regex dialect, and output format all diverge |
The headline insight: the silent failures are the dangerous ones. A tool that crashes
gets noticed; a tool that exits 0 with plausible-but-wrong output gets acted on — a grep
that reports "0 matches" when there are 8, a git diff that looks fine until you try to
git apply it. Most of this sweep was that class.
Fixed in this release
grep -hno longer dumps ripgrep's help.-his grep's--no-filenamebut rg's
--help, sogrep -rhoE PATTERN dirprinted the help text instead of searching. The flag
is now stripped before rg, and its no-filename intent is preserved via rg's own
--no-filenameso aggregating pipelines (… | sort | uniq -c) count by match.grep -creturns a bare count again. rtk no longer forces-n/-Hin output-format
mode, sogrep -c fileis3, notfile:3(andgrep -odrops thefile:line:noise).git diffpasses through verbatim. It was being rewritten into a--- Changes ---
summary that no patch tool accepts (git apply/patch/git amrejected it). It's now a
valid unified diff —git apply --checkpasses.git showkeeps its commit-display
compaction;--stat/--no-compactare unaffected.
Already fixed in 0.42.0-algolia.3 (a deploy gap)
5 of the 9 reports were already fixed — the reporting sessions had simply been running the
installed algolia.2 binary. Reinstalling closes them: rg-only flags forwarded verbatim,
full output through a > redirect, the EACCES/exit-127 crash on cat/ls, and identifier
mangling (reasoning → n) in search output. Lesson now codified: always verify a bug
report against a freshly-built binary, not the installed one.
Known limitation (documented, not "fixed")
grep with a BRE pattern (literal () still errors under ripgrep's ERE engine. The hook
rewrites both grep and rg to the same handler, so it's dialect-blind — a BRE→ERE
translator would silently corrupt genuine rg patterns, trading a loud failure for a silent
one. Documented with a workaround (grep -F, or rtk proxy grep); the real fix
(route by source-tool identity) is tracked to land with the next upstream catchup.
Full per-fix detail in CHANGELOG.md;
per-report status under docs/bugs/.