Repository navigation
Conversation
Disable gitignore filtering in WalkBuilder so rtk find matches native find behavior. Previously git_ignore/git_global/git_exclude were all true, causing the ignore crate to respect .gitignore, global gitignore, and .git/info/exclude rules. This incorrectly filtered out files that are untracked or matched by global gitignore patterns (e.g. *.csv). Root cause: ignore::WalkBuilder with git_global(true) reads the user's global gitignore (e.g. ~/.config/git/ignore) and filters matching files, even when no local .gitignore rule applies. Regression test added: find_works_after_git_init creates a temp dir, verifies find works before and after git init.
|
Requesting review when convenient. This is a small behavior fix for |
…ind-after-git-init Resolve the find_cmd.rs conflicts in favor of upstream's disclosure architecture (gitignore-aware walk + disclosure of hidden/ignored matches, from the 0.46.0 find rewrite): rtk find no longer silently drops ignored files -- matches collected by the ignore rules are disclosed in the output, which addresses the user-visible symptom of rtk-ai#2589. Drop the original git_global(false) approach from this branch: it predates the upstream find rewrite and would revert the released disclosure behavior (breaking hidden_and_ignored_matches_are_collected_for_disclosure). Keep the rtk-ai#2589 regression test, strengthened: find_works_after_git_init now drives native_walk directly and asserts that a gitignored *.csv match is collected for disclosure after `git init` (the original test only checked is_ok(), which passed even with the bug present).
|
Thanks for the regression test and for chasing this down. The underlying problem was fixed by #3854, merged on 2026-09-03, which keeps gitignore filtering but discloses hidden and ignored matches instead of dropping them silently, and develop already carries an equivalent test (hidden_and_ignored_matches_are_collected_for_disclosure in src/cmds/system/find_cmd.rs). Running the reporter's case on current develop, rtk find ./ -name message.csv in a repo that ignores *.csv now reports the filtered match and the recovery log rather than an empty result, so this PR's test is covered. Closing as already handled, but please comment or reopen if you see a case it still misses. |
Summary
rtk findreturning empty results aftergit init(Bug:rtk findstops working aftergit init#2589)git_ignore/git_global/git_exclude) inWalkBuildersortk findmatches nativefindbehaviorTest plan
cargo clippy --all-targets && cargo test— 30/30 find_cmd tests pass, clippy cleanrtk find . -name "message.csv"returns correct results in git-initialized directory with global gitignore*.csvrule