Skip to content

cli: document that -c/--count can be inconsistent with -l/--files-with-matches#3157

Merged
BurntSushi merged 1 commit intomasterfrom
ag/document-count-inconsistency
Sep 23, 2025
Merged

cli: document that -c/--count can be inconsistent with -l/--files-with-matches#3157
BurntSushi merged 1 commit intomasterfrom
ag/document-count-inconsistency

Conversation

@BurntSushi
Copy link
Owner

This is unfortunate, but is a known bug that I don't think can be fixed
without either making -l/--files-with-matches much slower or changing
what "binary filtering" means by default.

In this PR, we document this inconsistency since users may find it quite
surprising. The actual work-around is to disable binary filtering with
the --binary flag.

We add a test confirming this behavior.

Closes #3131

…with-matches`

This is unfortunate, but is a known bug that I don't think can be fixed
without either making `-l/--files-with-matches` much slower or changing
what "binary filtering" means by default.

In this PR, we document this inconsistency since users may find it quite
surprising. The actual work-around is to disable binary filtering with
the `--binary` flag.

We add a test confirming this behavior.

Closes #3131
@BurntSushi BurntSushi force-pushed the ag/document-count-inconsistency branch from 75ebb6f to 956e84d Compare September 22, 2025 23:50
@BurntSushi BurntSushi merged commit 1b07c66 into master Sep 23, 2025
20 checks passed
@BurntSushi BurntSushi deleted the ag/document-count-inconsistency branch September 23, 2025 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rg -c omits files when a NUL byte is encountered after an earlier match

1 participant