Repository navigation
fix(server): a Git project's status and commits leave out the repositories inside it - #6
Open
na0s-fleet-agents[bot] wants to merge 1 commit into
Open
na0s-fleet-agents[bot] wants to merge 1 commit into
na0s-fleet-agents[bot] wants to merge 1 commit into
Conversation
…ories inside it When a project's own folder is a Git repository, the repositories the project covers inside it (pingdotgg#35925) showed up in the root repository's live Git views: status listed each as an untracked folder, the Uncommitted and Changes diffs and branch totals counted it, and Commit staged it as an embedded gitlink. The root's status, numstat, branch totals, working-tree review diff and commit-all now exclude those repositories, as checkpoints already do. The list comes from the project's folders (or the task folder's worktrees), and ones the root's .gitignore lists are dropped from the pathspec so git add does not fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
When a project's own folder is a Git repository and holds other repositories (which pingdotgg#35925 now counts as part of the project), the root repository's live Git views still include them.
git statuslists each one as an untracked folder (? api/), the Uncommitted and Changes diffs and the branch change totals count it, and Commit runsgit add -A, which stages it as an embedded gitlink ("adding embedded git repository"). Each of those repositories already has its own diff and Git actions, so they show up twice, and committing the root writes broken gitlinks into it.To reproduce: make a repository
shopwith a commit, clone orgit inittwo repositories with commits atshop/apiandshop/web, edit a file inshop, addshopas a project and open a thread. The commit dialog listsapi/andweb/next to the real change, and committing records both as gitlinks.Change
The root's Git views now leave out the repositories the project covers inside it, the same way checkpoints already do (
nestedScopePaths/excludedPathspecsinCheckpointService.tsandGitVcsDriver.ts).WorkspaceFolders.nestedRepositoriesreturns those repositories for a checkout: the project's folders (discoverFoldersplustrackedFolders) when the cwd is the project folder, or the task folder's worktrees when the cwd is a thread's copy of it. It keeps only folders inside the checkout and drops submodules, likenestedScopePaths.GitVcsDriverCorereads them through aVcsNestedRepositoriescontext reference (empty by default, likeVcsAutomaticFetchInterval, so tests and other builds keep plain Git behavior) and adds:(top,exclude,literal)pathspecs tostatus --porcelain=2, the statusdiff-index --numstat, the branch change totals, the working-tree and branch-range review diff, and the commit-allgit add -A..gitignorelists is dropped from the pathspecs aftergit check-ignore --no-index, as the checkpoint capture does:git addfails on a pathspec naming an ignored folder.server.tsprovides the reference before the firstGitVcsDriverbuild.docs/user/multi-repo-projects.mdsays the project folder's own repository leaves the inner ones out.Single-file diffs, the Commits source, and repositories a project does not cover (for example ones
t3.jsonignoreRepositorieslists) are unchanged.Scope
This is a small fix of an obvious bug in pingdotgg#35925's behavior: that change made repositories inside a project folder part of the project and already keeps them out of the root's checkpoints, but the root's live status, diff, and commit still include them. It needs no issue because the defect is a direct inconsistency with what pingdotgg#35925 does for checkpoints, and the fix only applies the same exclusion to the live views. No schema or UI copy changes.
Verification
GitVcsDriverCore.test.ts› "leaves the repositories a project covers out of its checkout's Git views" (real Git): a root repository with nestedapiandwebrepositories,webalso in the root.gitignore, and one root change. It checks status files, branch totals, the Uncommitted review files and patch, and that commit-all commits only the root change and leaves the tree clean. It fails onmain's driver (status listsapi/). With only the review or only the commit exclusion removed, the review or commit assertion fails.WorkspaceFolders.test.ts: two existing cases extended. One checks that a project folder resolves its discovered repositories (docs,src/web) and that a repository's own folder resolves none. The other checks that a task folder's copy of the project folder resolves its nested worktree (vendor/lib) when Git names the checkout by its resolved path.vp run check:changed origin/main: format, lint, knip, typecheck and tests pass (383 tests in 3 files).vp run scenarios:provewith a scenario (not committed) that seeds ashoprepository with nestedapiandwebrepositories and one change tonotes.md: the scenario fails on base1368854828("expected 2 to be 0" nested rows in the commit dialog) and passes on head.Commit dialog, before and after:
Diff pane, Uncommitted, and the thread details Git panel, before and after:
Not checked:
discoverFoldersdoes for checkpoints. I did not measure it.Made with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code