Repository navigation
Refactor duplicated search and index logic - #140
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved approval-blocking issues were identified.
Review tier: Balanced
Findings: None
What changed in this PR
Refactors duplicated search, indexing, serialization, and server logic while preserving existing behavior and public APIs.
Changes:
- Centralizes sorting and file-selection handling.
- Shares serialization, parsing, and ignore-publication helpers.
- Adds focused regression coverage.
| File | Description |
|---|---|
tgrep-core/tests/snapshot_consistency.rs |
Tests overlay and snapshot precedence. |
tgrep-core/src/ondisk.rs |
Adds shared serialization helpers. |
tgrep-core/src/hybrid.rs |
Reuses snapshot-aware lookup helpers. |
tgrep-core/src/external.rs |
Uses shared serialization logic. |
tgrep-core/src/builder.rs |
Removes duplicate serialization helpers. |
tgrep-cli/tests/ripgrep_compat.rs |
Tests explicit-file selection behavior. |
tgrep-cli/tests/indexed_files.rs |
Tests indexed and server sorting. |
tgrep-cli/src/serve.rs |
Shares parsing and ignore-publication logic. |
tgrep-cli/src/search.rs |
Centralizes sorting and file-selection outcomes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Preserves public APIs, the on-disk format, buffer sizes, output, and error handling. Similar-looking paths with different semantics remain separate. Adds focused regression coverage for sorting, binary/nonmatching files, parser defaults, serialization boundaries and I/O failures, and overlay/snapshot consistency.
Validation
cargo fmt --all -- --checkcargo clippy --workspace --benches -- -D warningscargo test -p tgrep-cli --test indexed_files --test concurrent_search