Repository navigation
Replies: 2 comments
|
Reproduced on git 2.50.1 (Apple Git-155) with your exact relative form What fires. With The environment scrub does not cover it.
So the answer to your question is yes — and the repository already carries the form. One scope note: hardening belongs on git invocations the harness starts for its own bookkeeping (working-tree snapshots, tree diffs, ignore checks, install probing). A Related: #9217 covers the fsmonitor half of the same boundary ( |
|
A mitigation for the half a plugin can reach is now published, so the gap can be
dsh plugin --profile <name> add @argszero/dsh-git-hook-guardMount it, or apply the bundled patch: - insert:
- id: git-hook-guard
name: '@argszero/dsh-git-hook-guard'
inject:
- subprocessIt shadows Three things about the shape, since they are what decides whether it is worth
What it does not cover, and the plugin prints this list on every snapshot
The real fix is still the in-tree one, and it is one line of shape: For anyone re-measuring: the discriminator that the existing environment scrub is |
Uh oh!
There was an error while loading. Please reload this page.
In the latest DSH Web and Desktop versions, workspace-changes runs git add automatically when a turn starts. If the opened project’s .git/config sets core.hooksPath, Git can run a post-index-change hook with the DSH user’s privileges, without a requested tool call.
Here is a harmless macOS/Linux reproduction. The hook only writes a marker:
demo_dir="$(mktemp -d)"
git init -q "$demo_dir/repo"
mkdir -p "$demo_dir/repo/.hooks"
printf 'demo\n' > "$demo_dir/repo/README.md"
cat > "$demo_dir/repo/.hooks/post-index-change" <<'EOF'
#!/bin/sh
printf 'hook ran\n' > ../dsh-poc-marker.txt
EOF
chmod +x "$demo_dir/repo/.hooks/post-index-change"
git -C "$demo_dir/repo" config --local core.hooksPath .hooks
printf 'Open in DSH: %s\n' "$demo_dir/repo"
Open the printed directory in DSH Web or Desktop and start a turn with “hello.” Then run cat "$demo_dir/dsh-poc-marker.txt" in the original shell. It prints hook ran.
Could the automatic snapshot disable repository-local hooks? This matters for copied or extracted projects that preserve their .git directory.
All reactions