Skip to content

Feat: Add .gitnexusignore support for custom path exclusions#86

Closed
ajmeese7 wants to merge 4 commits into
abhigyanpatwari:mainfrom
ajmeese7:feature/gitnexusignore
Closed

Feat: Add .gitnexusignore support for custom path exclusions#86
ajmeese7 wants to merge 4 commits into
abhigyanpatwari:mainfrom
ajmeese7:feature/gitnexusignore

Conversation

@ajmeese7

@ajmeese7 ajmeese7 commented Feb 26, 2026

Copy link
Copy Markdown

Problem

GitNexus has no way to exclude custom paths from indexing. All filtering is hardcoded in ignore-service.ts. Projects containing vendored bundles, generated files, or other artifacts not covered by the built-in defaults end up polluting the knowledge graph with noise — minified symbols, junk call chains, and misleading community detection.

For example, a project with a vendored QuestDB frontend bundle (qdb.43f98.js) gets minified class names like Xr, Je, Yn indexed as real symbols, consuming process slots and degrading search relevance.

Solution

Users can now place a .gitnexusignore file at the repo root using standard gitignore syntax:

# Vendored QuestDB frontend
backend/docker/questdb/public/

# Large generated files
*.generated.json

On the next gitnexus analyze, matched paths are excluded from indexing. If no .gitnexusignore file exists, behavior is identical to before.

Implementation

  • Adds the ignore npm package (24KB, zero deps) for full gitignore-spec pattern matching
  • loadCustomIgnore(repoPath) in ignore-service.ts reads the file and returns a predicate, or null if absent
  • walkRepositoryPaths() in filesystem-walker.ts accepts an optional custom filter applied alongside the existing hardcoded defaults
  • runPipelineFromRepo() in pipeline.ts loads the ignore file at pipeline start and passes it to the walker
  • The built-in default ignore lists are unchanged.gitnexusignore is additive
  • Added a "Custom Ignore Patterns" section to the README with usage examples

Additional fix

Fixes a pre-existing build error: duplicate let ftsLoaded declaration in kuzu-adapter.ts (lines 19 and 679) that caused both tsc and tsx/esbuild to fail.

Testing

Tested on a real 1,730-file monorepo (Go/Python/Rust/TypeScript). With a .gitnexusignore excluding one vendored bundle directory:

Metric Before After Delta
Nodes 7,617 7,611 -6
Edges 19,582 18,447 -1,135
Clusters 476 487 +11

The large edge reduction (-1,135) reflects removal of noisy relationships from minified code. The cluster count increased because community detection found more coherent groupings without the noise.

Verified via Cypher query that zero files from the ignored path remain in the index.

Users can now place a .gitnexusignore file at the repo root to exclude
paths from indexing using standard gitignore syntax. This is useful for
vendored bundles, generated files, or other paths not covered by the
built-in defaults.

Adds the `ignore` npm package for gitignore-spec pattern matching.
The variable was declared twice at module scope (line 19 and line 679),
causing TypeScript and esbuild to fail compilation.
@vercel

vercel Bot commented Feb 26, 2026

Copy link
Copy Markdown

@ajmeese7 is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@jecanore

Copy link
Copy Markdown
Contributor

Hey @ajmeese7! I opened PR #301 which includes .gitnexusignore support using the same ignore npm package approach you pioneered here. I combined it with the unsupported language crash fix (completing PR #188) since both issues tend to hit the same users (e.g., Expo/React Native repos with iOS Swift files). Thanks for the groundwork — your approach validated the ignore package choice. 🙏

@ajmeese7

Copy link
Copy Markdown
Author

Guess it was implemented by someone else.

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.

2 participants