Repository navigation
feat(config): add include to force gitignored first-party source into the index - #137
Merged
Merged
Conversation
…to the index Ports upstream colby #1063: an `[indexing] include` list of gitignore-style, root-relative path patterns (a dir, a `**` glob, or a single file) that forces first-party source INTO the index even when `.gitignore` excludes it — the case of a repo tracked by a second VCS (SVN/Perforce) whose sources are gitignored so they never land in git. Complements the existing `exclude` (its opposite). Off by default: an empty `include` leaves scan and watch behavior byte-identical. `include` is a separate decision applied AFTER the ordered gitignore/exclude model: a path the model would ignore is force-included iff it matches `include`, is not under a built-in skip (node_modules/.git/.godot/dist/…, never re-includable), and does not match an explicit config `exclude` (exclude wins). Precedence: built-in skip > exclude > include > the existing ordered ignore_paths/exclude/.gitignore model with `!`-negation, which is unchanged. The scanner also descends an otherwise-ignored directory when it is an ancestor of an include pattern, so an included file or nested glob under a gitignored parent is reached, while non-included files under it stay pruned. The force-include/exclude path decision is unified across crates via a single exported `codegraph_extract::include_exclude_pattern_matches` (whole-relative-path semantics), used by both the extractor scan and the watcher's WatchPolicy, so `codegraph index`, `codegraph sync`, and the live file-watcher agree on scope — `sync` output stays byte-for-byte equal to `index --force`. Threaded through ExtractOptions, WatchPolicy, WatchOptions, and DaemonOptions. Golden .schema and all fixtures unchanged (file-selection only; no regen).
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #137 +/- ##
==========================================
- Coverage 95.65% 95.64% -0.01%
==========================================
Files 115 115
Lines 55790 56459 +669
==========================================
+ Hits 53364 54000 +636
- Misses 2426 2459 +33
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upstream-sync Release B — ports colby #1063 (
2a06d9a): an[indexing] includelist of gitignore-style, root-relative path patterns (dir,**glob, or single file) that forces first-party source into the index even when.gitignoreexcludes it. Solves the dual-VCS case (SVN/Perforce sources gitignored so they never land in git). Complements the existingexclude. Off by default — emptyincludeis byte-identical to today.includeis a separate decision applied AFTER the ordered gitignore/exclude model: force-include iff matchesinclude, not under a built-in skip (node_modules/.git/.godot/dist — never re-includable), and not matching an explicitexclude(exclude wins). Precedence: built-in skip > exclude > include > existing ordered model (unchanged!-negation).codegraph_extract::include_exclude_pattern_matches(whole-relative-path semantics) used by both the extractor scan and the watcherWatchPolicy, socodegraph index,codegraph sync, and the live watcher agree —syncstays byte-for-byte equal toindex --force. Threaded through ExtractOptions / WatchPolicy / WatchOptions / DaemonOptions.Verification
make cigreen (fmt + clippy + test + guardrail + equivalence)..schema+ fixtures byte-identical, NO regen (file-selection only).include = ["gen*"]both indexes AND watches a gitignoredgen/helper.tsconsistently (the divergence an initial oracle review caught and this fixes); plus builtin-skip-never-reincluded, exclude-wins, ancestor-file, and empty-include-byte-identical tests.Release B of the chosen 1.2.0→1.4.1 upstream PORT subset.