Repository navigation
Conversation
The `<rev>:<path>` form of `git show` prints a file at a revision, i.e. a file read, but it was routed to passthrough and emitted uncompressed (0% savings), while the `<rev> -- <path>` diff form already compacts. Route the blob form through the same filtering `rtk read` applies: minimal comment/blank-line stripping with language detected from the path extension, capped at the same 500-line default the diff form uses, guarded by `never_worse` so small files pass through unchanged. The `--stat` and `--format` variants keep their previous behavior. Fixes rtk-ai#3116
Collaborator
|
Thanks for digging into this. The blob form is filtered on develop now: #3265 (merged 2026-09-11) routes |
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
git show <rev>:<path>prints a file at a revision (a file read), but it was routed to passthrough and emitted uncompressed at 0% savings, while the<rev> -- <path>diff form already compacts.rtk readapplies: minimal comment/blank-line stripping with language detected from the path extension, capped at the same 500-line default the diff form uses, guarded bynever_worseso small files pass through unchanged.git show --statand--formatvariants keep their previous behavior.Fixes #3116
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test(2444 lib tests pass, zero clippy warnings)src/cmds/git/git.rs: blob-path extraction, comment stripping, 500-line cap with truncation marker, unknown-extension faithfulness,never_worseon tiny input, and a ≥60% savings checkrtk git show HEAD:Cargo.toml— small file, byte-identical to raw (faithful)rtk git show HEAD:src/cmds/git/git.rs— 3325-line file capped to 500 lines with a[2692 more lines]marker