feat(read,git): add read diet mode and smarter git diff filtering#552
feat(read,git): add read diet mode and smarter git diff filtering#552bz00qa wants to merge 2 commits intortk-ai:developfrom
Conversation
Read enhancements: - Add `rtk read --diet` mode for markdown: strips code blocks, collapses tables, removes checklists/HTML comments, collapses blank lines - 7 new tests for diet mode including token savings verification Git diff improvements: - Auto switch to stat-only for diffs >1000 lines (prevents token bloat) - Binary file detection (shows "(binary file)" instead of raw content) - Skip context lines in hunks (only show +/- changes, not surrounding code) - 3 new tests for large diff, binary, and context stripping Clippy fixes: - Replace deprecated `map_or(false, ...)` with `is_some_and(...)` in git.rs - Replace `.last()` with `.next_back()` in git.rs and container.rs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: bz00qa <bz00qa.hub@gmail.com>
b55150d to
9da454d
Compare
Remove orthogonal clippy refactors (next_back, is_some_and) that belong in a separate chore PR. Add CHANGELOG.md and README.md entries for read --diet mode and smarter git diff. Signed-off-by: bz00qa <bz00qa.hub@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: bz00qa <bz00qa.hub@gmail.com>
Apply clippy suggestions carved out from feature PRs rtk-ai#551 and rtk-ai#552: - container.rs: .last() → .next_back() (2 instances) - git.rs: .map_or(false, ...) → .is_some_and(...) (2 instances) - git.rs: .last() → .next_back() (1 instance) - init.rs: unnecessary format!() → .to_string() (1 instance) - init.rs: unnecessary & on &str parameters (2 instances) Signed-off-by: bZ00qa <167500396+bz00qa@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This PR has merge conflicts with git fetch upstream develop
git rebase upstream/develop
git push --force-with-leaseLabeling |
|
|
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
Summary
Read Diet Mode
rtk read --diet <file>: Markdown-aware filtering that strips verbose patterns while preserving essential content- [ ],- [x])===,~~~)Smarter Git Diff
Clippy Fixes
map_or(false, ...)withis_some_and(...)in git.rs.last()with.next_back()in git.rs and container.rsChanges
src/read.rsdiet_markdown()+run_diet()+ 7 testssrc/git.rssrc/container.rsnext_back()fixessrc/main.rs--dietflag on Read command + routingTest plan
cargo fmt --all --checkpassesrtk read --diet CLAUDE.md— verify reduced outputrtk git diffon a repo with binary files🤖 Generated with Claude Code