fix(local): shell-quote git args in the auto-patch push and trial-build gate #126
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/fix-git-shell-quoting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The first real
auto-apply-patchesrun classified, limited to the top-10, and validated the candidate registry cleanly, then died at the push step:Root cause: R's
system2()with captured output (stdout=TRUE) runs the command through/bin/sh, and the arguments were passed unquoted. The commit messagefeat(patches): ...contains(), which the shell tried to interpret. The same class of bug affects the^{commit}andref:pathgit refs in the trial-build gate.Fix
shQuote()every git argument:propose-patches.R-- thegit()helper used by--open-pr(commit, push, checkout).trial-build-registry.R-- the base-ref reads (rev-parse ... ^{commit},ls-tree,show ref:path).Verification
unexpected "("); theshQuoted call commits successfully, andrev-parse HEAD^{commit}resolves.Everything else in that run was correct: 842,659 failing builds classified, RcppParallel's 895 dependents correctly reported as blocked (not proposed), top-10 tbb-stddef candidates selected, 69 deferred, registry validated. Only the shell quoting was broken.
The autonomous --open-pr run failed at `git commit` with `sh: syntax error: unexpected "("`: R's system2() with captured output runs the command through /bin/sh, and the commit message `feat(patches): ...` (and the `^{commit}` / `ref:path` git refs in the trial-build gate) contain shell metacharacters that were passed unquoted. shQuote() every git argument in propose-patches.R's git() helper and in trial-build-registry.R's base-ref reads. Reproduced the failure and verified the fix against a real git repo (commit with "()" in the message now succeeds; a `HEAD^{commit}` rev-parse resolves).