Skip to content

fix(search, searchset): --quick reports no row when nothing matched - #4767

Merged
jqnatividad merged 2 commits into
masterfrom
searchset-quick-not-one-no-match
Oct 8, 2026
Merged

jqnatividad merged 2 commits into
masterfrom
searchset-quick-not-one-no-match

Conversation

@jqnatividad

Copy link
Copy Markdown
Collaborator

On an unindexed file, --quick printed the total row count to stderr when nothing matched. That's the same place a match's row number goes, so callers can't tell a no-match from a match on the last row.

The indexed (parallel) path already printed nothing on no-match. The sequential path now matches it and prints the row only when there was a match.

--quick on unindexed input, no match before after
search row count on stderr, exit 1 nothing, exit 1
search --not-one row count on stderr, exit 0 nothing, exit 0
searchset nothing, exit 1 nothing, exit 1
searchset --not-one row count on stderr, exit 0 nothing, exit 0

Tests: search_quick_nomatch_reports_no_row and searchset_quick_nomatch_reports_no_row cover plain --quick, --quick --not-one, and the indexed --jobs 2 path. I mutation-checked them: with the fix reverted, both fail, with stderr "4\n" and "6\n" (the row counts). The search and searchset suites pass on all_features, lite and datapusher_plus. clippy and double-run-check are clean.

🤖 Generated with Claude Code

jqnatividad and others added 2 commits October 8, 2026 16:18
The sequential path printed row_ctr -- by then the total row count -- to
stderr whenever --quick found nothing: `search` before returning NoMatch,
and `searchset` when --not-one turned the no-match into a success. That
reads as the row of a match. Print only when there was a match, as the
indexed (parallel) path already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jqnatividad
jqnatividad merged commit 00bbf84 into master Oct 8, 2026
19 checks passed
@jqnatividad
jqnatividad deleted the searchset-quick-not-one-no-match branch October 8, 2026 20:26
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