Skip to content

[Bug]: File scanner (initial or subsequent) ignores all files because of wrong interpretation of .gitignore #154

@smuuf

Description

@smuuf

Bug Description

File scanner/indexer (initial or subsequent) ignores all files because of (what I think is) wrong interpretation of .gitignore:

I have this in my repo's root .gitignore:

# Ignore all dot-directories in the repo root.
/.*/

... which tells git to ignore all directories with names starting with . located in the repo root. Works as it should.
But I think that grepai interprets it wrongly and then this happens:

[smuuf@smuuf-hp]$ grepai watch
Starting grepai watch in /my/lovely/project
Provider: ollama (nomic-embed-text)
Backend: gob
RPG: disabled
2026/02/20 16:04:08 Watching project: /my/lovely/project (backend: gob)

Performing initial scan...
Initial scan complete: 0 files indexed, 0 chunks created, 0 files removed, 0 skipped (took 0s)
Building symbol index...
Symbol index built: 0 symbols extracted

When I comment it out:

# Ignore all dot-directories in the repo root.
# /.*/

... then grepai properly starts to index files in my repo:

[smuuf@smuuf-hp]$ grepai watch
Starting grepai watch in /my/lovely/project
Provider: ollama (nomic-embed-text)
Backend: gob
RPG: disabled
2026/02/20 16:12:56 Watching project: /my/lovely/project(backend: gob)

Performing initial scan...
Indexing [███████████████░░░░░]  76% (2269/2993) ...vents/blablabla.php

Steps to Reproduce

  1. Have a project with some files.
  2. Put .gitignore with line /.*/ in the project's root.
  3. Run grepai init; grepai watch
  4. Nothing is scanned.

Expected Behavior

grepai shouldn't interpret having /.*/ in gitignore as "ignore everything" and should scan/index the project as expected.

Actual Behavior

grepai skipped/ignored all files in the repository and scanned/indexed 0 files.

grepai Version

repai version 0.32.1

Operating System

Linux

Embedding Provider

Ollama

Relevant Logs

Configuration

Checklist

  • I have searched existing issues to avoid duplicates
  • I am using the latest version of grepai

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions