Repository navigation
box: a status git cannot read stops the call before the version commit is built - #379
Conversation
…t is built A failed git status was discarded by the -z test, so a corrupt index read as clean and REMOTE_CMD exported BLOOMERY_GIT_COMMIT without its -dirty mark. The status is a checked assignment now, read only where the HEAD reads: a tree whose HEAD succeeds stops rc 70 naming the tree and Git's exit code before REMOTE_CMD, and the self-test's scratch tree carries a committed HEAD with a corrupt-index check at that boundary.
There was a problem hiding this comment.
Verdict: CLEAN: The status check rejects Git failures before constructing the version export, and the regression assertion rejects the old behavior.
Non-blocking
⚠ Use English for the new comment: tools/box.sh:1144. CONTRIBUTING.md requires English comments. Replace the three lines with # Reject unreadable dirt before exporting a known commit; trees without HEAD keep unknown. This keeps the new contract readable without a later translation edit.
Checked
Duplicates: no new functions, types or constants; no shared owner needed for this short check.
Complexity: no Rust functions changed. Dryer and crapper did not run.
Silent failure: 1 changed status read followed through the version export. Failed reads, including partial stdout, exit 70. Direct, local and queued execution share the check.
Tests: bash syntax and five isolated guard cases passed. The original status line returns 0 on Git exit 128; the added want 70 assertion rejects that result. The PR body reports the full self-test and negative control.
Gates: one corrupt-index regression case added; none removed or relaxed. No pins moved.
Escape catalog: no new C1–C4 pattern matched; Git's status is captured before another command can replace it.
Notes
The full self-test was not rerun; it creates scratch files outside the permitted review outputs.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
@Burntgogi Thanks for the contribution. The review is done, so I'm merging this. |
Fixes #365.
A failed
git statuswas discarded by the-ztest, so a corrupt index read as clean andREMOTE_CMDexportedBLOOMERY_GIT_COMMITpointing at a commit whose dirt nobody saw.st=$(git -C "$HERE" status --porcelain 2>/dev/null)), under the condition the check serves: a tree whose HEAD reads. A tree the status fails on stops rc 70 naming the tree and Git's exit code, beforeREMOTE_CMDis constructed. A tree with no readable HEAD keeps its previous path (COMMIT=unknown), which is not the defect the issue names.printf 'x' > .git/index, then the call must end rc 70 naming$HEREandgit exit 128, say what the mark would have been, and never reach ssh.Checks on the fixed tree:
tools/box.sh --self-testpasses whole. The negative control — the same self-test against a copy carrying the old-zline — endsself-test 4 failed(rc 0, want 70, no tree/message in the output, and the command reached ssh).