Repository navigation
chore: sync upstream rtk-ai/rtk v0.42.0 + keep local filter fixes - #11
Merged
Merged
Conversation
Core fix (src/init.rs — uninstall()): - Added step 3b after existing @RTK.md removal: checks for <!-- rtk-instructions marker in CLAUDE.md and removes the block using the existing remove_rtk_block() helper - Handles both artifacts in a single pass (covers edge case where both @RTK.md and the instructions block exist, e.g. after running both rtk init -g and rtk init -g --claude-md) - If CLAUDE.md becomes empty after cleanup, deletes the file Hardening: - Extracted RTK_BLOCK_START and RTK_BLOCK_END constants — all marker matching across uninstall(), upsert_rtk_block(), remove_rtk_block(), patch_claude_md(), and show_config() now uses these instead of duplicated string literals - When uninstall finds nothing to remove, prints which paths were checked to help users diagnose path issues - resolve_claude_dir() error message now shows %USERPROFILE% on Windows instead of $HOME Signed-off-by: Adrien Eppling <adrien.eppling@supinfo.com>
Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
- Force LC_ALL=C so ls always outputs English month names regardless of system locale - When no lines are parsed (e.g., non-English locale where regex fails to match), fall back to raw output instead of returning '(empty)' - This prevents silent data loss for users in zh_CN/ja/ko/etc. locales - Fixes rtk-ai#1276
Next Release
…master--components--rtk chore(master): release 0.37.0
…tk-ai#1250) The installer previously ran `tar -xzf` on the downloaded archive with no pre-extraction verification. A malicious mirror could ship a tarball with `../` components or absolute paths and write files anywhere on the user's filesystem (CWE-22). Add a pre-extraction check that lists archive contents with `tar -tzf` and rejects any entry whose name starts with `/` or contains a `..` path component. The check is POSIX-compliant and adds negligible overhead for the single-binary RTK release tarball. Covered by scripts/test-install.sh, which exercises one safe archive and four crafted malicious archives (leading `..`, absolute path, mid-path `..`, trailing `..`) plus a regression guard that ensures the check remains in install.sh. Co-Authored-By: Claude <noreply@anthropic.com>
…tk-ai#1362) `head -N file1 file2 ...` was rewritten to `rtk read file1 file2 ... --max-lines N`. The capture regex was greedy (`(.+)$`), so every file argument was folded into a single string. `rtk read` then silently mis-handled the shape and fell through to the system `read` builtin (`/usr/bin/read`) which rejects paths starting with `/` as "not a valid identifier". Tighten each head/tail regex to a single non-whitespace file argument (`\S+$`). When >1 file is provided the regex misses, `rewrite_line_range` returns `None`, and the command falls through to the native `head` / `tail` binary — which already handles multi-file input with the expected `==> name <==` banners. Same class as the cat multi-file fix in rtk-ai#989. Added six regression tests covering the `-N`, `--lines=N`, `-n N`, and `--lines N` variants for both `head` and `tail`.
- Move . and .. detection before date parsing (is_dotdir) for non-English locale compatibility - Add dotdirs counter to distinguish empty dir (only . and ..) from real content that failed to parse - Fix test_compact_empty to use real ls -la output (includes . and ..) - Add test_compact_empty_chinese_locale for Chinese locale empty dir case - Closes regression where fallback falsely triggered on empty directories
fix(docs): user facing docs
…master--components--rtk chore(master): release 0.37.1
Rebased onto current develop (binary-command era). Threads dry_run through patch_settings_json_command, migrate_old_hook_script, install_cursor_hooks, run_kilocode_mode, run_antigravity_mode, run_gemini, run_copilot, and uninstall. Fixes from PR rtk-ai#1032 review: - --uninstall --dry-run no longer deletes files (uninstall() now takes dry_run, every fs::remove_file / fs::write / atomic_write guarded) - Success messages ("installed", "configured", "Restart ...") gated on !dry_run in run_default_mode, run_hook_only_mode, run_codex_mode, run_copilot, install_cursor_hooks, run_gemini - prompt_telemetry_consent() skipped in dry-run - integrity::store_hash() in run_gemini guarded - KiloCode and Antigravity modes now accept dry_run - PatchResult::WouldPatch variant added for patch_settings_json_command - [dry-run] Nothing written. footer printed by every sub-mode - write_if_changed uses atomic_write (not fs::write) Added integrity::hash_path_for() public wrapper so dry-run can check sidecar existence without the destructive remove_hash. Tests: write_if_changed(dry_run=true) creates nothing; run_codex_mode_with_paths(dry_run=true) creates neither RTK.md nor AGENTS.md. 1596 tests pass, clippy clean.
Next Release
…master--components--rtk chore(master): release 0.37.2
Create Next Release PR and set up the description with fix / feat PRs and issues to be closed
- Force LC_ALL=C so ls always outputs English month names - When zero lines parsed but directory has content, fallback to raw output - Add is_dotdir() to distinguish empty dirs (only . and ..) from unparseable content - Fix empty directory regression for both English and non-English locales - Closes rtk-ai#1276
…removals
The two remove_file calls flagged by semgrep already existed pre-PR.
Wrapping them in if dry_run { print } else { remove_file } shifted
their context enough that --baseline-commit re-attributed them as new.
The rule's own message says deletion is expected in hooks/init cleanup.
Fix seems counter intuitive but it helps a lot on my machine. Before, I had 234 errors (23%) out of 1,000 tests run; now, I only have one (0.1%) It's not totaly fixed but it reduce error a lot and avoids having one almost every time I test a PR. Another way to completly fix it would be to use std::fs::set_times on old.trx to set each time in the past, but it requires unstable fs_set_times feature, so I'm not sure you'll agree with that Signed-off-by: Nicolas Le Cam <niko.lecam@gmail.com>
…eady be as small as possible
Addresses three review items from PR rtk-ai#1032: - Bundle verbose+dry_run into a Clone+Copy InitContext struct (mirrors RunOptions in src/core/runner.rs). Collapses 25+ function signatures that already carried both fields and makes future flags one struct field instead of N signature changes. - Emit "[dry-run] Nothing written." exactly once from the top-level run() and uninstall() exit points instead of from every sub-mode. Fixes the double footer when --agent cursor combined with default mode. - Reject --show with --dry-run via clap conflicts_with rather than silently ignoring --dry-run. - Add regression tests for run_default_mode and uninstall dry-run paths using the existing with_claude_dir_override scaffolding.
Adds a "Preview without writing" subsection under Step 1 covering the --dry-run flag, -v interaction for content preview, that telemetry consent is skipped, and the --show conflict. Required by CONTRIBUTING.md section 4 (new features need documentation).
- Avoid underflow + 0 results caused by overwrite of global constant CAPS - Soon user will be able to apply global configuration, this will change global CAPS and should not cause any underflow or 0 results, if overwrite sub >= CAPS -> use CAPS.
When user runs 'git log -1 --format='%H' HEAD' where HEAD is a merge commit, rtk was adding --no-merges which filtered out the merge commit itself and returned the second parent instead. This made 'git log -1' return wrong SHAs for merge commits. Fix: don't add --no-merges when user explicitly passes -n N or --max-count=N. When a user specifies an exact count they expect exactly that many commits, not filtered results. Also skip --no-merges if user already passed --merges or --no-merges explicitly. Fixes rtk-ai#2009.
refacto(truncations): Set global CAPS for truncation
The compact `git status` path ran `git status --porcelain -b -uall`. The `-uall` flag expands fully-untracked directories into every file, while raw `git status` collapses them (e.g. `node_modules/`). This made rtk output larger than raw — measured ~29x on a 200-file untracked dir (5500B vs 191B) — violating RTK's compress-or-match-raw invariant and inflating tokens. Remove `-uall` so untracked directories collapse exactly like raw. This keeps rtk-ai#991's actual fix intact: all modified/staged/renamed/conflict paths are still shown with no grouped summaries or `... +N more` overflow markers (`-uall` never affected those lines). Untracked files in partially-tracked dirs and any paths git itself expands are still preserved by the formatter. Measured (rtk vs raw git status): - node_modules/ (200 files): 5500B (-2780%) -> 25B (+87% savings) - normal (8 mod + 2 untracked): +71% -> +76% - 17 modified (rtk-ai#991 case): unchanged at +58%, all 17 shown, 0 overflow markers Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix(git): drop -uall from compact status so output never exceeds raw
…-doc-test docs(git): sync status README with --porcelain -b
Next Release
…master--components--rtk chore(master): release 0.41.0
fix: honor explicit -n N limit for git log on merge commits
feat(hook): add pi support
Next Release
…master--components--rtk chore(master): release 0.42.0
Merge upstream/master (v0.42.0, 187 commits ahead) into master, resolving: Mechanical: - Cargo.toml / .release-please-manifest.json: take upstream version 0.42.0 - CHANGELOG.md: union of both histories (release-please regenerates) - Cargo.lock: regenerated via cargo build against merged Cargo.toml Code conflicts: - grep_cmd.rs: KEEP both murphytek translate_bre_pipes (bare-| literal fix #6) AND upstream has_format_flag — distinct functions, both still referenced. - main.rs: KEEP all JVM imports — murphytek gradle_cmd/ant_cmd/mvn_cmd AND upstream gradlew_cmd. All four command families have enum variants + routing. - rules.rs (semantic collision surfaced by upstream tests): upstream's `gradle`/`gradlew` -> `rtk gradlew` rewrite rule SUPERSEDES murphytek's earlier `-> rtk gradle` rule. Upstream's gradlew command (1400 LOC: Android tasks, lint/ktlint/detekt, Windows shims) is the richer, maintained path. The explicit `rtk gradle` subcommand remains for direct use; only the auto-rewrite is upstream's now (RegexSet is last-match-wins, so the duplicate had to go). - stack_trim.rs: removed pre-existing dead test helper lines_of (deny-warnings). Preserved murphytek filter fixes: grep bare-| (#6), wc filenames-with-spaces (#8), tree director+file overmatch (#9). cargo build --release + cargo test (1986 unit + 12 integration) both green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👋 Thanks for the PR! It looks like this targets Please update the base branch:
See CONTRIBUTING.md for details. |
Pre-existing clippy::type_complexity on the probe_mvn_version CACHE static (deny-warnings in CI's `cargo clippy --all-targets` gate). Extract the (u32,u32,u32) into a VersionTriple alias per clippy's own suggestion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Sync murphytek/rtk fork up to upstream rtk-ai/rtk v0.42.0 (was 187 commits behind), preserving murphytek's local filter bug-fixes and JVM (Gradle/Maven/Ant) command support.
Conflicts resolved (6)
Mechanical
Cargo.toml/.release-please-manifest.json→ upstream version 0.42.0CHANGELOG.md→ union (release-please regenerates on next release)Cargo.lock→ regenerated viacargo buildCode
src/cmds/system/grep_cmd.rs— keep BOTHtranslate_bre_pipes(murphytek bare-|literal fix fix(grep): treat bare | as literal pipe (BRE), not rg alternation #6) and upstreamhas_format_flag; distinct functions, both referenced.src/main.rs— keep ALL JVM imports: murphytekgradle_cmd/ant_cmd/mvn_cmd+ upstreamgradlew_cmd. All four command families have enum variants + routing in the merged body.src/discover/rules.rs— semantic collision (surfaced by upstream's tests): upstream'sgradle/gradlew → rtk gradlewrewrite rule supersedes murphytek's earlier→ rtk gradlerule. Upstream'sgradlewcommand (1400 LOC: Android tasks, lint/ktlint/detekt, Windows shims) is the richer, maintained path. The explicitrtk gradlesubcommand is retained for direct use; only the auto-rewrite is upstream's now (the classifier is last-match-wins, so the duplicate rule had to be dropped).src/cmds/jvm/stack_trim.rs— removed pre-existing dead test helperlines_of(workspace denies warnings).Preserved murphytek fixes
|literal (fix(grep): treat bare | as literal pipe (BRE), not rg alternation #6)director+fileovermatch (fix(tree): stop dropping entries whose names contain 'director'+'file' (output-mangling sweep) #9)(PR #10 — find UTF-8 char-boundary — remains separately open and is not part of this sync.)
Validation
cargo build --release✅ →rtk 0.42.0cargo test✅ 1986 unit + 12 integration, 0 failures🤖 Generated with Claude Code