Development record
PrimaryWorktreeRoot trusts rev-parse stdout: git rev-parse echoes an unrecognised option to stdout and exits 0, and --path-format only exists from git 2.31, so on an older git the --git-dir, --git-common-dir and --show-toplevel answers read as the flag text plus the path and every comparison silently fails closed to no primary store; validate each answer as a single absolute path or drop the flag
issueresolvedminoriss-2608291924452604
PrimaryWorktreeRoot trusts rev-parse stdout: git rev-parse echoes an unrecognised option to stdout and exits 0, and --path-format only exists from git 2.31, so on an older git the --git-dir, --git-common-dir and --show-toplevel answers read as the flag text plus the path and every comparison silently fails closed to no primary store; validate each answer as a single absolute path or drop the flag
Grounds
- pursued: no inherited private store is ever resolved from a rev-parse answer that is not one absolute path; a primary resolved under a git that prefixes its answers would show it wrong
Frontmatter
| id | iss-2608291924452604 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2608291924452604-primaryworktreeroot-trusts-rev-parse.md
open on GitHub ↗ · commit history ↗
mentions1
- iss-2608292038186663v0.6.9 combined ruthless review: nine wrappers around 'git rev-parse --show-toplevel' exist and only one validates the answer. internal/core/site/outdir.go checkoutRoot holds the output to a single absolute line that contains the invoking directory; the other eight — internal/surface/cli/cli.go, internal/surface/cli/banlist.go, internal/core/capture/roots.go, internal/core/ahoy/remote.go, internal/core/banlist/worktree.go, cmd/record-lint and cmd/scaffold-sync, plus the site one — each re-derive the call. Proposal: one gitutil.Toplevel(dir) carrying the single-absolute-line-containing-the-invoking-directory rule, with every wrapper calling it. This REFINES iss-2608291924452604 (the ledger has no typed link, so the relation is stated here and in related_issues).