-
Notifications
You must be signed in to change notification settings - Fork 2
Consolidate the dual exclusion system (glob patterns + gitignore) into a single unified mechanism. #78
Copy link
Copy link
Open
Labels
techdebtWork needed to reduce technical debt, improve maintainability, refactor code, etc.Work needed to reduce technical debt, improve maintainability, refactor code, etc.
Description
Feature Request: Unified Exclusion Mechanism
Summary
Consolidate the dual exclusion system (glob patterns + gitignore) into a single unified mechanism.
Current State
excludepatterns: checked via glob pattern matchingexclude_gitignored: separate boolean flag with git ls-files check- Two different code paths in
limits.lua:should_exclude_file()
Proposed Change
Merge gitignore content into the exclude patterns list during config setup:
limits = {
exclude = { "node_modules/**", "dist/**" }, -- user patterns
exclude_append = { "custom/**" }, -- additional patterns
exclude_gitignored = true, -- load .gitignore into exclude list
}Result: Single unified exclude list containing user patterns + gitignore patterns
Benefits
- Simpler logic: One exclusion check instead of two
- Better performance: No per-file git calls, single pattern matching
- Consistent behavior: All exclusions work the same way
- Easier testing: Single exclusion mechanism to test
Implementation
- During config setup, if
exclude_gitignored = true, load gitignore files and append to exclude list - Remove separate gitignore checking logic from
limits.lua - Use single
matches_glob_pattern()check for all exclusions
Considerations
- Breaking change: would need migration strategy
- Gitignore patterns may need conversion to glob patterns
- Cache invalidation when .gitignore changes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
techdebtWork needed to reduce technical debt, improve maintainability, refactor code, etc.Work needed to reduce technical debt, improve maintainability, refactor code, etc.