Skip to content

Honor ignore rules outside Git repos during indexing - #168

Draft
Anandb71 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-ignore-rules-not-honored
Draft

Honor ignore rules outside Git repos during indexing#168
Anandb71 with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-ignore-rules-not-honored

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

In non-Git directories, Arbor was effectively indexing without exclusions, so vendored/dependency trees (e.g., venv, node_modules, site-packages) could dominate graph size and ranking. This change makes ignore behavior consistent between Git and non-Git workspaces.

  • Ignore semantics in non-Git directories

    • Updated watcher traversal to apply .gitignore even when .git/ is absent (require_git(false)).
    • Enabled custom ignore file support for .arborignore.
  • Arbor-native and built-in excludes

    • Added ignore matcher composition for:
      • built-in heavy-tree excludes (venv/, .venv/, node_modules/, site-packages/, __pycache__/, target/, dist/, build/, out/)
      • .arbor/config.json ignore entries
    • Applied this matcher to both full indexing and staleness checks (sources_newer_than), so behavior is consistent across index/read paths.
  • Coverage for regression-prone paths

    • Added focused tests validating exclusion from:
      • .gitignore outside Git repos
      • .arborignore
      • .arbor/config.json ignore list
let walker = WalkBuilder::new(root)
    .git_ignore(true)
    .ignore(true)
    .require_git(false)                  // honor .gitignore outside git repos
    .add_custom_ignore_filename(".arborignore")
    .follow_links(options.follow_symlinks)
    .build();

Co-authored-by: Anandb71 <169837340+Anandb71@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ignore rules not honored outside a git repository Honor ignore rules outside Git repos during indexing Aug 8, 2026
Copilot AI requested a review from Anandb71 August 8, 2026 08:59
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

🌳 Arbor Impact Report

Risk Level: 🟠 High | Blast Radius: 50 nodes | Changed Symbols: 21

Changed Files

File Status
crates/arbor-watcher/src/indexer.rs Modified

📊 Visual Impact Graph

graph TD
  classDef changed fill:#ef4444,stroke:#333,stroke-width:2px,color:#fff;
  classDef caller fill:#f59e0b,stroke:#333,stroke-width:1px,color:#fff;
  index_directory[index_directory] --> build_ignore_matcher[build_ignore_matcher]
  sources_newer_than[sources_newer_than] --> build_ignore_matcher[build_ignore_matcher]
  class build_ignore_matcher changed;
  class IndexResult changed;
  class ArborConfig changed;
  class DEFAULT_EXCLUDE_PATTERNS changed;
  class IndexOptions changed;
  class sources_newer_than caller;
  class index_directory caller;
Loading

Impact Summary

Metric Count
Direct callers affected 23
Indirect callers affected 41
API entrypoints impacted 40
Files likely requiring updates 6
Total blast radius 50

⚠️ Warning: 40 API entrypoints are affected. Integration tests recommended.

🔍 Suggestion: Consider breaking this change into smaller PRs.


Powered by Arbor v2.6.0 — graph-native code intelligence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore rules (.gitignore / .arbor config) not honored outside a git repo — venv/vendored trees bloat the graph

2 participants