Skip to content

Enhances ignore pattern handling with gitignore support#7

Open
alexstewartja wants to merge 11 commits into
andycufari:mainfrom
alexstewartja:improve-ignores
Open

Enhances ignore pattern handling with gitignore support#7
alexstewartja wants to merge 11 commits into
andycufari:mainfrom
alexstewartja:improve-ignores

Conversation

@alexstewartja

Copy link
Copy Markdown

This pull request improves file exclusion logic by leveraging .gitignore files for defining ignore patterns.

Key improvements:

  • Replaces custom ignore pattern logic with industry-standard ignore package
  • Provides full gitignore compatibility, including negation patterns and nested directories
  • Adds comprehensive testing to validate ignore pattern handling and caching
  • Improves performance through caching of the ignore matcher

This change removes the hardcoded ignore patterns and relies on .gitignore for more robust and configurable behavior.

@alexstewartja

Copy link
Copy Markdown
Author

@andycufari Conflicts resolved

@andycufari

Copy link
Copy Markdown
Owner

Hi @alexstewartja,

Thank you for this comprehensive improvement to our ignore pattern handling! The migration to the ignore package and full gitignore compliance is exactly what we need.

I have a question about the design decision to maintain both .gitignore support and ClaudePoint-level ignore patterns (additionalIgnores).

Current approach in your PR:

  • Reads .gitignore patterns
  • PLUS maintains additionalIgnores config option
  • PLUS always ignores .checkpoints/

Question: What's the reasoning behind having both systems? Most tools use a single ignore mechanism.

Alternative approach:
Would it be simpler to just use .gitignore + the ignore package with minimal additions:
// Always ignore our own directory
ig.add(['.checkpoints/']);

// Use .gitignore for everything else
ig.add(gitignoreContent);

This would:
✅ Follow standard conventions
✅ Reduce configuration complexity
✅ Be more intuitive for users
✅ Still allow custom patterns via .gitignore

Use case question: Are there specific scenarios where additionalIgnores would be needed that can't be handled by adding patterns to .gitignore?

Looking forward to your thoughts on this design decision!

Best,
Andy

@alexstewartja

Copy link
Copy Markdown
Author

Hey @andycufari,

Thanks for taking a look! I'll try to answer your question as concisely as possible.

The preservation of additionalIgnores is to allow for advanced workflows.

A notable example is my use case where I additionally ignore /.git. This keeps the checkpoint archive size small.

My checkpoint and version control workflows differ considerably, hence, advanced usage.

@alexstewartja

Copy link
Copy Markdown
Author

@andycufari You are welcome to test this PRs functionality with:

claude mcp add claudepoint -- npx -y github:alexstewartja/ClaudePoint

@alexstewartja

Copy link
Copy Markdown
Author

@andycufari I see you silently ignored (pun intended) this PR and implemented the ignore npm package anyway. I guess you can close this whenever you choose

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.

3 participants