martha#53: a GIT_DIR the line exports is read, so a push from the worktree place is judged at the clone #66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "vesta/53-exported-git-dir"
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?
Refs #53. Fixes the one hole #53 names: a
GIT_DIRa shell exports was not read, soexport GIT_DIR=<clone>/.git; git pushfrom the worktree place reached the clone's default branch with no rule meeting it.What the reader now carries
The shell's own
GIT_DIR, from where a line exports it to the calls after it:export GIT_DIR=<path>names the repository of every command after it, across separators and across the lines of one command string — including the words a shell's syntax puts a command after ({,then,else,elif,do,!, andcommand/builtinhanding their command over).declare -xandtypeset -xexport their names; adeclarewithout-xkeeps them to the shell alone and is not read.X=1 export GIT_DIR=…), and the value such an assignment holds is the oneGIT_DIR=… export GIT_DIRmarks.GIT_DIR=<path>standing as a command of its own updates it — also when only more assignments and redirections follow it — andexport GIT_DIRmarks the value the shell already holds.cdmoves it as it moves git; git's own--git-dirand an inlineGIT_DIR=stand over it.Nothing in the line takes the export back (r=2, the Supervisor's fail-closed ruling).
unset GIT_DIR,export -n GIT_DIRand adeclare's+xchange nothing here, and a name only ever raises the export: Uranus's r=2 read showed that a drop a shell may not really make — in a branch that does not run, in a pipeline or a background command, in a case arm, or in a comment — let a line drop the export it made and push unseen. The subshell's own)still drops it, because that shell really does end. The cost is a rare false refusal (export GIT_DIR=x; unset GIT_DIR; git push), which the refusal line names so the member can drop the export.No rule, check or notice changes: the call carries the repository as
gitDirectory, as the inline form already did, and a push with no refspec in the clone it names is refused as the push onto the default branch that it is.Evidence
''where /main is the default branch/ was expected), r=1's eight shapes, and r=2's fail-closed tests — logs in Vesta's session directory (vesta-53-red.log,vesta-53-r1-red.log,vesta-53-r2-red.log).vesta-53-r2-check/): every line whose real bash reaches the clone is REFUSED, including all of his r=2 shapes. The lines that still pass are the$Dvariable forms, filed as #68.vesta-53-mutants/).Limits, stated rather than left to be discovered
set -a/allexportis a second way to export, filed as #67 with its probe, not folded in here.export GIT_DIR=$D) isnull, and the call is judged at the worktree: filed as #68.-C, as a relative--git-diralready is (#53's note N3). No harm lands on it: git resolves it after-Cand finds no repository there.Uranus's r=1 read found the shapes the first version missed, each now read as the shell reads it: - the words a shell puts a command after (`{`, `then`, `else`, `elif`, `do`, `!`) and the ones that hand the command over (`command`, `builtin`) begin a command, so the export written behind them is the shell's; - `declare -x` and `typeset -x` export their names, and a `declare` without -x does not; - an export is read after the prefix assignment that stands before it (`X=1 export GIT_DIR=…`), and the value such an assignment holds is the one `GIT_DIR=… export GIT_DIR` marks; - `unset -f` names a function, not the variable; an option after the first name is a name; and a drop written in a command that may not run (`false && unset GIT_DIR`) is no drop, so the reader fails towards the refusal; - a `)` with no subshell open (a case arm's own) closes nothing here and drops nothing; - an assignment followed only by more assignments and redirections is the shell's own variable, not one command's. A keyword puts a command after it without moving the directory a `cd` behind it names: that rule is unchanged, since the branch may not run.Overlap check against main
611f48db(Terra):comm -12of this PR's files (4) and main's since the merge base (56):git merge-tree --write-tree origin/main <head>conflicts. Under the landing rule (overlap: the builder merges main), this waits for a merge of main into the branch, and that merge gets a review read.611f48dbinto vesta/53-exported-git-dir: keep both ends of the test file1840e66c(PR 99, martha#98) into vesta/53-exported-git-dir277f2773(PR 62, martha#60) into vesta/53-exported-git-dir