Skip to content

v0.42.0-algolia.4

Latest

Choose a tag to compare

@github-actions github-actions released this 25 Jun 16:01
· 1 commit to main since this release

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 greprg: 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 -h no longer dumps ripgrep's help. -h is grep's --no-filename but rg's
    --help, so grep -rhoE PATTERN dir printed 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-filename so aggregating pipelines (… | sort | uniq -c) count by match.
  • grep -c returns a bare count again. rtk no longer forces -n/-H in output-format
    mode, so grep -c file is 3, not file:3 (and grep -o drops the file:line: noise).
  • git diff passes through verbatim. It was being rewritten into a --- Changes ---
    summary that no patch tool accepts (git apply/patch/git am rejected it). It's now a
    valid unified diff — git apply --check passes. git show keeps its commit-display
    compaction; --stat/--no-compact are 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 (reasoningn) 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/.