Bug: `rtk find` stops working after `git init`
Description
rtk find stops finding files after the directory is initialized with git init. Before git init, it works correctly.
Steps to Reproduce
-
In a non-git directory, create a file and run
rtk find:# No .git directory exists touch message.csv rtk find ./ -name "message.csv" # ✅ Returns: ./message.csv -
Initialize git, then run the same command:
git init rtk find ./ -name "message.csv" # ❌ Returns: 0 for 'message.csv' (empty) -
The raw
findcommand still works:find ./ -name "message.csv" # ✅ Returns: ./message.csv -
rtk proxy(bypasses filtering) also works:rtk proxy find ./ -name "message.csv" # ✅ Returns: ./message.csv
Expected Behavior
rtk find should return the same results as find regardless of git status.
Actual Behavior
- Before
git init:rtk findworks correctly - After
git init:rtk findreturns no results
Root Cause
rtk's output filtering logic incorrectly suppresses find command results when the working directory is under git version control.
Environment
- rtk version: 0.42.4
- OS: macOS (arm64)
- Shell: zsh
wshm · Automated triage by AI
🔍 Automated Triage
| 🐛 Category | bug |
| 🟠 Priority | high |
| 🎯 Confidence | 97% |
Summary
rtk find silently returns empty results in git repos due to incorrect output filtering; PR #2598 already open by reporter.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use
/wshm fixto attempt it.
📁 Relevant files
src/parser/mod.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Closing as a duplicate of #2995. Your file was dropped by a global gitignore rule that rtk find applies only inside a git repository, which is why git init changed the result. #2995 tracks rtk find applying gitignore pruning where native find does not. Please follow up there.