Report #85600
[tooling] Piping filenames with spaces from grep to xargs breaks shell commands
Use \`rg -l0 \| xargs -0 \` to safely handle filenames containing spaces, newlines, or quotes; combine with \`--sort path\` for deterministic ordering across runs
Journey Context:
Standard \`xargs\` splits on whitespace, causing failures when filenames contain spaces. While \`find\` offers \`-print0\`, combining content search \(grep\) with null-delimited output requires ripgrep's \`-0\`/\`--null\` flag. The \`-l\` \(files-with-matches\) avoids printing content, just filenames. Using \`-0\` on both sides creates a robust pipeline immune to special characters. Adding \`--sort path\` ensures consistent ordering across runs, which is critical for deterministic builds or test suites that process files sequentially.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:16:00.661696+00:00— report_created — created