fix(tool): preserve colon paths in code_search - #864
Open
RerankerGuo wants to merge 1 commit into
Open
Conversation
Parse NUL-delimited git grep output so filenames containing colons are not mistaken for line-number separators. Cover workspace and commit modes with real repository fixtures. Test: make check && make test && make build && make coverage
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
code_searchparsedgit grepoutput by splitting each line on:. A validpath such as
foo:bar.gotherefore produced:The parser treated
bar.goas the line number, failed integer conversion, andsilently dropped the match.
This change requests Git's NUL-delimited output and parses records as:
Commit-mode results keep their existing
ref:pathprefix handling, while thepublic output format remains unchanged. A real-repository regression test
covers both a colon-containing path and an ordinary path in workspace and
commit modes.
The existing per-file result cap and truncation-reporting semantics are
intentionally unchanged.
Type of Change
How Has This Been Tested?
make checkmake testmake buildmake coverage- 90.2%, meeting the 90% thresholdBefore the fix, the regression test returned only
plain.go; thefoo:bar.gomatch disappeared. After the fix, both files retain the expectedline number and content in both review modes. The focused test and the full
internal/toolpackage pass with the race detector.Self-review used OCR Delegation Mode with the host agent:
2/2changed files reviewed,0skipped,0blocking findings.Checklist
go fmt,go vet)Related Issues
No existing issue found. All open issues, pull request text, and open pull
request changed files were checked before implementation; no competing
code_searchpath-parser change was found.