Skip to content

chore(tools): Report searched-line count on no diff matches - #894

Merged
JeanMertz merged 1 commit into
mainfrom
git-diff-commit-regex
Jul 29, 2026
Merged

chore(tools): Report searched-line count on no diff matches#894
JeanMertz merged 1 commit into
mainfrom
git-diff-commit-regex

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

grep_diff now includes the number of lines searched in its no-match message, e.g. "No matches for pattern 'foo' in the diff output (9 lines searched)." Previously a zero-match result gave no indication of how much of the diff was actually scanned, making it hard to tell a narrow search window from a broken filter.

The line count is computed once from the search bounds and reused for both the no-match message and the "[Showing X/Y lines...]" note, so the two always agree on what "the diff" means when bounds are set.

`grep_diff` now includes the number of lines searched in its
no-match message, e.g. "No matches for pattern 'foo' in the diff
output (9 lines searched)." Previously a zero-match result gave no
indication of how much of the diff was actually scanned, making it
hard to tell a narrow search window from a broken filter.

The line count is computed once from the search bounds and reused
for both the no-match message and the "[Showing X/Y lines...]" note,
so the two always agree on what "the diff" means when bounds are
set.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz
JeanMertz merged commit 5e9dcab into main Jul 29, 2026
16 checks passed
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.

1 participant