Git guard: a repository named through a command substitution ($(...) or backticks) is not read as unread, so #68's refusal never meets it #88
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): a repository named through a command substitution (
$(...)or backticks) is read as unread (null), so martha#68's refusal applies to a push or a worktree remove/move through it. Today one form reads as "no repository named" and the other as a wrong path, and both are judged where the line was typed.Refs macula-io/martha#68 (found in the r=1 review of PR 85), #86 and #87 (the same class: a repository named in a way the reader does not follow), #53 (PR 66 owns
read_the_git_calls_in_a_shell_line.ts, so this waits for it).The instance (the r=1 review, fable, at
dc9ffe88, throughrefusalOfwith real git; typed in a member's worktree)GIT_DIR=$(pwd)/.git git push origin HEADgitDirectoryabsent: no repository namedGIT_DIR=`pwd`/.git git push origin HEADgitDirectory= a literal path containing the backticks: a wrong path, not nullWhy it matters
With
pwdalone the place happens to be the typed one. But the same shapes carry any command:GIT_DIR=$(cd ../<clone> && pwd)/.git git push origin HEAD, typed in a worktree, names the clone. Read as absent, it is judged at the worktree, and the push reaches the clone's main. That is the harm #68 closes for a variable. The backtick form fails open the same way, through a wrong path rather than null.What it would take
In the shell-line reader: a word holding
$(, or a backtick, in a repository position (GIT_DIR=,--git-dir,-C) reads as unread (null), as a variable does. #68's refusal then covers it with no change of its own. Red-first tests with real git, in the reader's test file.