Repository navigation
Conversation
yadm manages a separate dotfiles repository whose work-tree is HOME. The git rewrite rule enumerated yadm in its pattern and rewrite prefixes, so yadm commit/push/checkout/add were rewritten to 'rtk git' and acted on whatever project the shell was standing in. Remove yadm from the rule; the yadm filter now routes yadm to the yadm binary as 'rtk yadm <subcommand>', matching the already-correct 'yadm list' path. run_add also injected '.' when git add had no pathspec, turning real git's deliberate no-op into a whole-worktree stage. A bare 'rtk git add' now passes no pathspec, so nothing gets staged implicitly. Closes rtk-ai#3408
kylehgc
added a commit
to kylehgc/rtk
that referenced
this pull request
Aug 18, 2026
fix(rewrite): never rewrite yadm to rtk git; keep bare git add a no-op (adopt upstream rtk-ai#3414)
Contributor
|
This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet. |
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.
Fixes #3408
Two rewrite-layer defects that combine into a data-integrity problem.
1.
yadmis rewritten togitThe git rule in
src/discover/rules.rsenumeratedyadmin its pattern andrewrite_prefixes, sortk rewrite yadm statusproducedrtk git status.rtk gitexecutes the literalgitbinary in the current working directory. Since yadm manages a separate dotfiles repository whose work-tree is$HOME,yadm commit,yadm push,yadm checkout, andyadm addsilently redirected to the project repo the shell was standing in.yadm listalready routed correctly tortk yadm listbecause the yadm filter (src/filters/yadm.toml) handled it; the git rule shadowed that filter for exactly the subcommands it enumerated.Fix: remove
yadmfrom the rule's pattern andrewrite_prefixes. All yadm subcommands now route through the yadm filter tortk yadm <subcommand>, which executes the yadm binary against the dotfiles repo.2. Bare
git addgained a.src/cmds/git/git.rsinjected"."whengit addhad no pathspec. Realgit addwith no pathspec is a deliberate no-op ("Nothing specified, nothing added."). Through rtk it staged the entire working tree, including files the user had not tracked.Reproduced at v0.44.2 (
700bdde):Fix: a bare
rtk git addpasses no pathspec, so nothing gets staged implicitly. Verified after the fix:rtk git addstages nothing.Tests
discover::registry::tests::test_classify_yadm_status,test_classify_yadm_diff— yadm is no longer classified asrtk git.test_rewrite_yadm_status,test_rewrite_yadm_commit,test_rewrite_yadm_add— regression tests for the rewrite path.cmds::git::git::tests::test_add_with_no_args_gets_no_pathspec,test_add_with_args_passes_them_through— regression tests for the add pathspec behavior.cargo test(2566 + integration suites) passes;cargo clippy --all-targetsis clean.