Git guard: set -a / assignment shapes the reader misses (if/while/time/eval/\set/redirect, functions, read/printf -v/${:=}/for) let an exported GIT_DIR through #94
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 (bug): the git guard's shell-line reader stops letting a push through from the worktree when bash would export GIT_DIR, through any of the shapes below.
Found by the fable review of #67 PR 90 r=1 (comment 1390). Every shape is also blind at
aadf83c4, before PR 90, so it sits outside that package's diff. Supervisor ruling 2026-11-23: file it as its own issue, behind macula-fleet#8.Shapes the reader does not see, while bash exports GIT_DIR
Proof for each:
env -u GIT_DIR bash -c '<line>; env' | grep -c '^GIT_DIR='prints 1 (bash 5.3.20). Through the full guard path, a followinggit pushis judged at the worktree.A set -a the reader misses, because it is not at a command position it knows:
if set -a; then GIT_DIR=/c/.git; fiwhile set -a; do GIT_DIR=/c/.git; break; donetime set -a; GIT_DIR=/c/.giteval set -a; GIT_DIR=/c/.git\set -a; GIT_DIR=/c/.git>/dev/null set -a; GIT_DIR=/c/.gitA function body:
f() { set -a; local GIT_DIR=/c/.git; env; }; fAn assignment the reader does not read as one, under set -a:
set -a; read GIT_DIR <<< /c/.gitset -a; printf -v GIT_DIR %s /c/.gitset -a; : "${GIT_DIR:=/c/.git}"set -a; for GIT_DIR in /c/.git; do :; doneNoisy direction (the reader says exported, bash does not; notes only):
set -a; export -n GIT_DIR=...,set - -a,set -e - -a,true | set -a.Done when
An option, not decided
A reader that approximates bash will keep finding holes like these. One option is that the guard refuses any
set/declare/read/printf -vshape it cannot classify, instead of letting it through. That would be a new refusal, so it needs Raf's yes naming the harm (the no-new-checks rule). The Supervisor puts it to him when this issue is picked up, not now.Refs #67, #53, #68.
Git guard: set -a / assignment shapes the reader misses (if/while/time/eval/\\set/redirect, functions, read/printf -v/${:=}/for) let an exported GIT_DIR throughto Git guard: set -a / assignment shapes the reader misses (if/while/time/eval/\set/redirect, functions, read/printf -v/${:=}/for) let an exported GIT_DIR throughOne more shape found at #67 PR 90 r=2 (
24756f74). It is also blind at17048c2a:set -oo pipefail allexport; GIT_DIR=/c/.git; git push: in bash two o's take two words, so allexport is on and GIT_DIR is exported; the reader takes one word and judges the push at the worktree.