Skip to content

fix(scan): preserve tracked files without exposing ignored files - #320

Open
mldangelo-oai wants to merge 23 commits into
mainfrom
mdangelo/codex/respect-scan-inventory-gitignore-20260808
Open

fix(scan): preserve tracked files without exposing ignored files#320
mldangelo-oai wants to merge 23 commits into
mainfrom
mdangelo/codex/respect-scan-inventory-gitignore-20260808

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve tracked source files and explicitly selected ignored files while keeping ignored directory descendants out of Git, snapshot, and nested-repository inventories.
  • Apply nested repository policies in Git checkouts and directory snapshots while preserving case-distinct source paths and excluding actual Git metadata on case-insensitive filesystems.
  • Normalize scoped paths, reject user-selected links before SDK canonicalization, and distinguish stale nested metadata from real Git failures.
  • Remove arbitrary timeouts for local Git and ripgrep commands.

Verification

  • bun test tests-ts/scan-inventory.test.ts tests-ts/targets.test.ts (26 passed).
  • Full SDK suite: 995 passed, 11 skipped, 0 failed.
  • Relevant runtime inventory regression, SDK type check, and formatting check.

@github-actions github-actions Bot added the bug Something isn't working label Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45f56e891a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/tests-ts/scan-inventory.test.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 45f56e891a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@mldangelo-oai mldangelo-oai changed the title fix(scan): keep ignored files out of security inventories fix(scan): preserve tracked files without exposing ignored files Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6677984b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: b6677984b7

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 540bbd4802

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 540bbd4802

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py

Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 52b82f9444

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52b82f9444

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb7c5ce615

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: bb7c5ce615

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1baf11d67c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 1baf11d67c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai
mldangelo-oai marked this pull request as ready for review August 8, 2026 07:17

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head f1b5274. Focus on efficient ignored-directory checks, Windows separator normalization, and production SDK rejection of symbolic path targets.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: f1b52740a4

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1b52740a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/src/targets.ts Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 515feca. Verify Windows case-equivalent target roots, component-by-component symlink checks, tracked-file recovery through canonical paths only, and ignored-file protections.

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 515fecae4a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 515fecae4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 1e537e0. Verify component-by-component lstat checks, Windows reparse-point and mixed-case protections, safe tracked-file recovery, ignored-directory secrecy, and case-equivalent scan roots.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e537e01e5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 1e537e01e5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head fc4e93c. Verify component-wise scope and tracked-path checks, Windows junction/reparse-point rejection, Git and non-Git snapshots, ignored files, and case-equivalent repository roots.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc4e93c20e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: fc4e93c20e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 15f786b. Verify filesystem-identity keyed nested worktrees, case-distinct Windows directories, junction-safe scope and tracked paths, ignored-file isolation, and canonical scan inventories.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head bf59601. Verify stale root Git markers safely fall back to snapshots without exposing .git metadata, while preserving nested worktree identity, ignore rules, Windows junction rejection, and tracked-file recovery.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf59601b39

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head c6724ee. Verify malformed and stale Git markers fall back safely, all case variants of Git metadata stay excluded, and Windows junction, ignore-file, nested-worktree, and tracked-file protections remain intact.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6724ee3f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head cf67b34. Verify explicit Git metadata rejection, malformed nested markers, regular ignore files, pruned Windows junctions, case-distinct nested worktrees, tracked paths, and canonical scope boundaries.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: cf67b342b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: cf67b342b1

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread sdk/typescript/_bundled_plugin/scripts/generate_in_scope_files.py Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head 498b40f. Focus on case-sensitive Git metadata exclusions, ordinary snapshot source directories, Windows metadata aliases, and ignored tracked files.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 498b40f771

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

]
reject_symbolic_ignore(directory_path)

metadata_glob = "--iglob" if case_insensitive_metadata else "--glob"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Scope case-insensitive metadata globs to actual aliases

When a scanned tree contains both a case-equivalent entry that samefile() identifies as Git metadata and an unrelated case-distinct .GIT source directory, this tree-wide switch makes both negative globs case-insensitive and removes the ordinary source directory too. On current HEAD, a case-sensitive snapshot with stale hard-linked .git/.GIT marker files and src/.GIT/source.py inventories only the unrelated visible file; mixed-sensitivity Windows trees have the equivalent failure. Fresh evidence beyond the earlier unconditional-glob report is that the new alias detection is per-directory, but its result still changes matching globally; exclude only entries verified as metadata aliases.

Useful? React with 👍 / 👎.

rows = {
row
for row in rows
if (path := normalized(row.removesuffix(b"\n"))) in allowed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recover case-renamed tracked files from the working tree

On a case-sensitive filesystem with core.ignoreCase=true, renaming an indexed foo.py to FOO.py makes the cached listing contain foo.py, the other-files listing contain nothing, and ripgrep emit FOO.py; this membership test drops that row, while tracked-file recovery later checks the nonexistent lowercase path. I reproduced current HEAD producing an empty inventory in this state, so a scan can complete without reviewing the current tracked source bytes. Resolve missing cached entries to their unique on-disk case variant before filtering or supplementing them.

Useful? React with 👍 / 👎.

def git_metadata_path(parent: Path, name: str) -> bool:
if name == ".git":
return True
if name.casefold() != ".git":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recognize trailing-dot Windows Git metadata aliases

On Windows, an NTFS entry stored as .git. or .git can be created through an extended-length path and Win32 resolves it as an alias of .git, but this spelling check returns before samefile() can confirm that identity. Ripgrep sees the stored spelling, so neither !.git glob matches it; when the marker is stale or malformed and the root probe falls back to snapshot mode, its descendants can enter the inventory, and an explicitly scoped metadata path also passes validation. Treat trailing-dot/space Win32-equivalent names as candidates for the same identity check while preserving them as ordinary names on case-sensitive filesystems.

Useful? React with 👍 / 👎.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant