Repository navigation
Conversation
Hardened workspace deletion to check populated submodules recursively for dirty, ignored, or unpushed work and block deletion when a check fails. Linear: https://linear.app/fox-cli/issue/FOX-118/check-submodule-contents-before-deleting-a-workspace
Owner
Author
|
🔧 fox review (gpt-6-sol): Fixed a data-loss case in the PR’s submodule deletion check.
Fixes pushed to this branch in 52810ed; tests pass ( fox-review: 52810ed |
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.
Why: workspaces.mjs:197-206 and :222-226: the deletion guard inspects only the superproject. I created a pushed, clean checkout containing a pushed submodule, then placed
only-local.privateinside the submodule under its committed*.privateignore rule. Parentgit status --porcelainand parentls-files -z --others --ignored --exclude-standardboth returned empty, while the submodule's ls-files returned the local file;blockers('w1')returned []. Deleting the workspace would erase that ignored submodule file.Hardened workspace deletion to check populated submodules recursively for dirty, ignored, or unpushed work and block deletion when a check fails.
Try it: Use workspace folder deletion; it now keeps the folder when a submodule has local work.
Verified: node --test tests/workspaces.test.mjs: pass (23/23, exit 0); npm test: pass (252/252, exit 0); git diff --check: pass (exit 0).
Change: 2 files, 124 lines. Tests pass (
npm test), run by the job.Linear: https://linear.app/fox-cli/issue/FOX-118/check-submodule-contents-before-deleting-a-workspace
Merging publishes it to
releaseon the job's next run.Made by a fox job (20261104-160013-e71dc1).