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
Read Words the Shell Rewrites Before a Push in the Write Guard #2959
A local review of the #2951 change found these. Each is allowed by develop's guard as well, and none is listed in #2943, #2951, #2957, or #2958. Each was found by a classify probe on constructed commands, with the branch rules given as a test seam.
Words the Shell Rewrites Before Git Reads Them
The guard reads a push from its words as written, while the shell rewrites some of them first.
A quote-split word. The raw pre-filter _GIT_PUSH matches git ... push in the text, so git p''ush origin develop and git "pu"sh origin develop never reach the push check. The shell joins each into push, so a push to develop passes under a pull_request rule. The same split hides an include key from _GIT_INCLUDE, as in git -c 'inc''lude.path=/example/config' p.
A run-time word as a refspec.git push origin $(echo develop), a backticked form, and B=develop; git push origin $B are read as a branch literally named $(echo, and so on, not as develop.
An uppercase GIT._GIT_PUSH is case-sensitive while _is_git_exe is not, so GIT push origin develop passes. That only matters where the shell resolves GIT to git case-insensitively, as on Windows.
Possible Direction
Fail closed rather than model the expansion: run the pre-filters over the unquoted shell tokens rather than the raw text, deny a push whose refspec or remote word holds a $ or a backtick as unreadable, and match the pre-filter without case.
A later local review pass on the #2951 change found the same class through a backslash-newline. classify folds a backslash-newline into a space, while the shell joins the two halves into one word, so an include key split that way (inc, backslash-newline, lude.path=/example/config) reads to the guard as a -c inc override followed by a subcommand named lude.path=..., and the new include check never sees it. The split-word deny covers a command holding a push word only.
Activity
ptr727 commentedon Oct 13, 2026
A later local review pass on the #2951 change found the same class through a backslash-newline.
classifyfolds a backslash-newline into a space, while the shell joins the two halves into one word, so an include key split that way (inc, backslash-newline,lude.path=/example/config) reads to the guard as a-c incoverride followed by a subcommand namedlude.path=..., and the new include check never sees it. The split-word deny covers a command holding a push word only.Read Each Refspec's Push Operation, Include Overrides, and Fused Sepa…
Deny Include Overrides on Commits, Command-Running Subcommands, and N…
Fail Closed on Words the Shell Rewrites Before Git Reads Them in the …