rtk icon indicating copy to clipboard operation
rtk copied to clipboard

Bug: `rtk find` stops working after `git init`

Open Saerdna opened this issue 5 months ago • 2 comments

Description

rtk find stops finding files after the directory is initialized with git init. Before git init, it works correctly.

Steps to Reproduce

  1. 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
    
  2. Initialize git, then run the same command:

    git init
    rtk find ./ -name "message.csv"
    # ❌ Returns: 0 for 'message.csv' (empty)
    
  3. The raw find command still works:

    find ./ -name "message.csv"
    # ✅ Returns: ./message.csv
    
  4. 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 find works correctly
  • After git init: rtk find returns 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

Saerdna avatar Jun 24 '26 13:06 Saerdna

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 fix to attempt it.

📁 Relevant files
  • src/parser/mod.rs

Triaged automatically by wshm · This is an automated analysis, not a human review.

pszymkowiak avatar Jun 25 '26 14:06 pszymkowiak

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.

KuSh avatar Sep 26 '26 22:09 KuSh