Git guard: shell shapes still blind after #94 (stacked prefixes, a redirection after the command word, read/printf variants, case/select/getopts/declare -n/+=) #97
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Purpose (defect): the git guard's shell-line reader sees GIT_DIR wherever bash would hand it to git, so no shell shape left over from #94 lets a push reach a clone it was not judged against.
Where these come from
Mars's fable review of PR 96 (#94, Vesta) at
75e75ae8, record PR 96 c1505. It ran a 130-line differential against real bash 5.3.20 (scripts and outputs in ~/.claude/sessions/mars-scratch/r96/: mine.mjs, mine.wt.out). At the tip, 35 lines are still blind: bash exports GIT_DIR and the reader misses it. None of them is one of the lines #94 lists, so they were not folded into PR 96 (no scope creep). They are listed here.Still blind: cousins of #94's shapes
afterAKeywordgoes only one deep (read_the_git_calls_in_a_shell_line.ts:842 at75e75ae8):if ! set -a,if command set -a,if >/dev/null set -a,time eval set -a,eval eval set -a,command eval set -a,eval command set -a,time -p set -a.set >/dev/null -a,set > /dev/null -a,<<< x set -a.eval "set -a",eval "export GIT_DIR=x".while read GIT_DIR; do git push; done <<< xunderset -aor afterexport GIT_DIR;read GIT_DIR <<</c/.git(no space);read -p x GIT_DIR;read X GIT_DIR(a named limit);< <(…).-vGIT_DIR,-v GIT_DIR -- %s x,-v GIT_DIR /c/.git, and formats other than one %s (a named limit).set \⏎-a.Blind and outside #94's list
case x in x) set -a;; esac;case … export GIT_DIR=…;select GIT_DIR in …;((GIT_DIR=5));getopts a GIT_DIR;declare -n r=GIT_DIR; r=…;GIT_DIR+=….The class
Each shape the reader learns by name leaves its neighbours blind. The refuse-unknown option (refuse a git call whose shell line the reader cannot fully follow) is still the owner's choice, as #94 records. This issue keeps the list until that choice is made.
A check that fails mechanically
Each line above becomes a red-first test named after its shape, and a line in the differential against real bash (vesta-94-diff.mjs or a successor). A blind line fails by name.
Refs #94, PR 96.
Two more blind shapes, from Mars's fable review of PR 96 r=1 at
d44e343f. Both are outside #94's list, so they were not folded in. Bash exports GIT_DIR; the reader says undefined.set:set >/dev/null -a; GIT_DIR=/c/.git; git pushandset -o >/dev/null allexport; GIT_DIR=/c/.git; git push. (set -a >/dev/nullreads correctly.):=over an empty export:export GIT_DIR=; : "${GIT_DIR:=/c/.git}"; git push. Bash exports /c/.git because:=also defaults an empty value. The no-colon form agrees.Also noisy, the recoverable direction:
GIT_DIR=/a; set -a; : "${GIT_DIR=/c/.git}". Bash exports nothing; the reader says /a.