ripgrep always adds a newline at the end of data (including when --passthru
is used)
#2474
Labels
bug
A bug.
--passthru
is used)
#2474
Using ripgrep 13.0.0 on Ubuntu 22.10, the argument
--passthru
adds a new line at the end of data (so it can't be used to get only changes explicitly requested with the-r
argument). It seems to be a bug, the documentation doesn't refer to adding a newline, but onlyPrint both matching and non-matching lines
, implying that data should be the same at the end of the process (unless replacements occur).Example of the issue:
Expected result: no newline added at the end, like
sed
or other similar tools:Here's an example with
diff
:The same process with
sed
results in a different output fordiff
:$ git restore lorem.txt $ sed -i 's/lorem/Lorem/g' lorem.txt $ git diff
The text was updated successfully, but these errors were encountered: