Sandbox: a sandboxed command can replace a submodule's .git, which host Git recurses into
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- git, typescript
Research direction
Start with src/main/tools/sandbox_git.ts and trace how validateSandboxGit protects the top-level Git metadata; inspect #262 for how protected top-level names handle renames. The issue lists several possible approaches, so first compare them against submodule gitlinks and sandbox command handling. Done means host Git cannot run planted submodule filters after a sandboxed command, with the chosen behavior covered by tests.
Written by the indexing model from the issue text.
Description
Follow-up to #273. Patch's own Git calls (Git panel, chat Git context) no longer look inside submodules: status and diffs run with --ignore-submodules=dirty, and checkout/restore with submodule.recurse=false.
What remains is the sandbox side: a submodule's .git is a working-tree entry (a gitfile, or an in-tree folder), so a sandboxed command can replace it with planted metadata, for example a folder whose config defines filter.x.clean plus a .gitattributes in the submodule. validateSandboxGit (src/main/tools/sandbox_git.ts) protects only the top-level .git, HEAD and the Git directories. The next git status the user runs in their own terminal or editor recurses into the submodule and runs that filter outside the sandbox.
Protecting <submodule>/.git by path is not enough on its own: the submodule folder itself stays writable, so a command can rename it away and create a new one with planted metadata. Options:
- Protect each submodule
.gitnamed by the index's gitlinks and also refuse (or undo) a rename of the submodule folder, as #262 does for protected top-level names. - After each sandboxed command, compare every submodule's
.gitwith a snapshot and report or restore a changed one. - Document that host Git in a project with submodules can run code a sandboxed command left behind, as USAGE.md already says for hooks and filters of existing integrations.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 2
- Avg merge
- 5h 28m
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PierrunoYT/patch
-
Claude Code chats: tool calls made inside Claude Code subagents leave cards that end as "(stopped)"Openbug priority: low severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
PierrunoYT/patch#289 ·
Maintainers usually reply within 1 day
-
bug priority: medium severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PierrunoYT/patch#285 ·
Maintainers usually reply within 1 day
-
priority: medium security severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
PierrunoYT/patch#283 ·
Maintainers usually reply within 1 day
-
priority: low security severity: low
Difficulty 4/5 1-2 days Newbie friendliness 38/100
PierrunoYT/patch#293 ·
Maintainers usually reply within 1 day
-
priority: low security severity: low
Difficulty 3/5 1-2 days Newbie friendliness 67/100
PierrunoYT/patch#292 ·
Maintainers usually reply within 1 day
All issues in PierrunoYT/patch