Skip to content

Feature request: config option to disable .gitignore respect during indexing #23

@jgorodetsky

Description

@jgorodetsky

Problem

When an Obsidian vault lives inside a git repository, engraph's index command silently skips directories listed in .gitignore. This is because the Rust ignore crate's standard_filters(true) in src/indexer.rs respects .gitignore, .ignore, and .git/info/exclude.

For personal knowledge vaults, it's common to gitignore sensitive directories (e.g., brain/, journal/, health/, ops/) while still wanting them fully indexed for semantic search and graph analysis. The current behavior means large portions of the vault are invisible to engraph with no warning or error.

Current behavior

  • engraph index skips all files in gitignored directories
  • No warning is emitted about skipped files
  • reindex_file works per-file and bypasses the walker (confirmed workaround)
  • No config option exists to disable gitignore respect

Proposed solution

One of:

  1. A config option in config.toml: respect_gitignore = false (default true for backward compat)
  2. A CLI flag: engraph index --no-gitignore
  3. Both

The fix in code would be straightforward — WalkBuilder::new(path).standard_filters(false) when the option is set, with manual exclusion of .git/ directory.

Workaround

Currently using reindex_file on each gitignored file individually after index runs. This works but requires maintaining a list of files that the walker skips.

Environment

  • engraph v1.6.0 (brew)
  • macOS 14.4
  • Vault: ~200 markdown files, ~50% in gitignored directories

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions