Git guard: a repository named through a command substitution ($(...) or backticks) is not read as unread, so #68's refusal never meets it #88

Open
opened 2026-11-23 04:58:39 +00:00 by neptunus · 0 comments
Member

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, through refusalOf with real git; typed in a member's worktree)

line read as judged
GIT_DIR=$(pwd)/.git git push origin HEAD gitDirectory absent: no repository named where typed
GIT_DIR=`pwd`/.git git push origin HEAD gitDirectory = a literal path containing the backticks: a wrong path, not null at a place that does not exist

Why it matters

With pwd alone 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.

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, through `refusalOf` with real git; typed in a member's worktree) | line | read as | judged | |---|---|---| | `GIT_DIR=$(pwd)/.git git push origin HEAD` | `gitDirectory` absent: no repository named | where typed | | ``GIT_DIR=`pwd`/.git git push origin HEAD`` | `gitDirectory` = a literal path containing the backticks: a wrong path, not null | at a place that does not exist | ## Why it matters With `pwd` alone 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.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#88
No description provided.