You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide Whether an Unquoted Directory Option Value Fails Closed in the Write Guard #2977
A local review of the #2959/#2961 fix found this. It is allowed by develop's guard as well, and the fix leaves it open on purpose. Each shape was found by a classify probe on constructed commands.
An Unquoted Directory Option Value That Word Splitting Splits
The #2959/#2961 fix fails closed on a run-time word among a push's or a commit's global options, but it reads a -C, --git-dir, or --work-tree value as it stands, unquoted too. Word splitting can turn an unquoted value into more options before the subcommand.
X='. -c core.hooksPath=/dev/null'; git -C $X commit -m x runs a commit under a hooks-path override.
X='x -c core.hooksPath=/dev/null'; git --git-dir=$X commit -m y does the same.
The exemption is kept because an unquoted git -C $W commit and git -C $W push origin <branch> are common agent spellings, and denying them would block ordinary work far more often than the shape above occurs. A value with no subcommand word after it, such as git -C $X, is denied by the fix.
Possible Direction
Decide whether the unquoted directory value is worth failing closed on. If it is, require the value to be split-free, as the fix already does for a commit option's value, and accept the over-denial of an unquoted -C $W on a push or commit.
CodeRabbit raised a wider form of this on the #2980 promotion. The split value can carry the subcommand and its arguments, so the word the guard reads as the subcommand becomes a trailing argument:
D='. commit -n --allow-empty -m'; git -C $D status runs a commit with its hooks skipped, while the guard reads status as the subcommand and never reaches the commit or push checks.
D='. push --force origin HEAD:main -o'; git -C $D status hides a forced push the same way.
A classify probe on constructed commands allows git -C $D status, git -C $D commit -m x, and git -C $D push origin feature/x on both develop's guard (4a0370f) and main's guard (ae63f7b), so this is no allow flip from the #2959/#2961 fix, and the decision this issue asks for covers it too. The reviewer's proposed direction is the one already written above: exempt a directory value only where _split_free holds, keeping -C "$dir" allowed and denying an unquoted -C $dir. That denial now reaches any subcommand, not only a push or a commit, since the hidden one can sit behind status.
Maintainer decision (2026-10-14): fail closed unless split-free. Exempt a -C, --git-dir, or --work-tree value only where _split_free holds, so a literal path and a quoted "$W" stay allowed and an unquoted $W is denied for every subcommand, not only a push or a commit. The deny message should name quoting the variable as the fix. The decision label is removed. The issue stays open for the implementation, which runs as its own guard lane with the develop-versus-branch differential.
Activity
Fail Closed on Words the Shell Rewrites Before Git Reads Them in the …
ptr727 commentedon Oct 14, 2026
A Split Value That Supplies the Subcommand Itself
CodeRabbit raised a wider form of this on the #2980 promotion. The split value can carry the subcommand and its arguments, so the word the guard reads as the subcommand becomes a trailing argument:
D='. commit -n --allow-empty -m'; git -C $D statusruns a commit with its hooks skipped, while the guard readsstatusas the subcommand and never reaches the commit or push checks.D='. push --force origin HEAD:main -o'; git -C $D statushides a forced push the same way.A
classifyprobe on constructed commands allowsgit -C $D status,git -C $D commit -m x, andgit -C $D push origin feature/xon both develop's guard (4a0370f) and main's guard (ae63f7b), so this is no allow flip from the #2959/#2961 fix, and the decision this issue asks for covers it too. The reviewer's proposed direction is the one already written above: exempt a directory value only where_split_freeholds, keeping-C "$dir"allowed and denying an unquoted-C $dir. That denial now reaches any subcommand, not only a push or a commit, since the hidden one can sit behindstatus.Promote the pr_review.py Cleanup Subcommand and the Write-Guard Inclu…
ptr727 commentedon Oct 14, 2026
Maintainer decision (2026-10-14): fail closed unless split-free. Exempt a
-C,--git-dir, or--work-treevalue only where_split_freeholds, so a literal path and a quoted"$W"stay allowed and an unquoted$Wis denied for every subcommand, not only a push or a commit. The deny message should name quoting the variable as the fix. Thedecisionlabel is removed. The issue stays open for the implementation, which runs as its own guard lane with the develop-versus-branch differential.Fail Closed on Split Directory Values and Hidden Git Command Words in…