fix(extraction): detect untracked files inside untracked directories (#1213)#1215
Open
maxmilian wants to merge 1 commit into
Open
fix(extraction): detect untracked files inside untracked directories (#1213)#1215maxmilian wants to merge 1 commit into
maxmilian wants to merge 1 commit into
Conversation
…olbymchenry#1213) git status --porcelain collapses an entirely-untracked directory into a single '?? dir/' entry. collectGitStatus only recurses into such dirs to find embedded git repos, so source files in a plain untracked directory were never surfaced to sync — 'codegraph sync' reported 'Already up to date' and the watcher missed them too. Add -uall so git lists individual untracked files. Nested untracked git repos still collapse to '?? repo/' even with -uall (git never crosses a repo boundary), so the embedded-repo recursion is unaffected. Export getGitChangedFiles and add regression tests for both the plain untracked-directory case and the embedded-repo recursion (no -uall regression). Root-cause analysis and fix suggested by the reporter in colbymchenry#1213.
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
Fixes #1213.
codegraph syncsilently skipped source files that live inside an untracked directory, reporting "Already up to date" and never picking them up (the file watcher missed them too).Root cause
git status --porcelain --no-renamescollapses an entirely-untracked directory into a single?? frontend/entry instead of listing the files inside it.collectGitStatus(src/extraction/index.ts) treats such?? dir/entries as possible embedded git repos and recurses viafindNestedGitRepos— which only returns directories that are themselves git repos. A plain untracked directory has none, so its source files are never added tochanges.added.(The reporter's diagnosis was against v1.3.0, where the entry was simply skipped; on
mainthe untracked-dir handling now exists but only covers embedded repos, so the same files still slip through.)Fix
Add
-uallso git lists individual untracked files (?? frontend/app.js) rather than collapsing the directory. Verified that nested untracked git repos still collapse to?? repo/even with-uall— git never crosses a repo boundary — so the existing embedded-repo recursion is unaffected.One-line behavior change; root-cause analysis and the
-uallfix were suggested by the reporter in #1213.Tests
getGitChangedFilesis exported and covered by two regression tests:-uallregression).Both pass;
tsc --noEmitis clean; the existingsync/multi-repo-workspace/worktree-detectionsuites remain green.