docs(recovery): state why git add -u is safe, not merely consistent #1137
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!1137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/1136-followup-add-u-rationale"
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?
Follow-up to #1136, which merged while this was being written. No close keyword — #1135 is already closed by that merge.
@surveyor's
REQUEST_CHANGESon #1136 carried two findings. The first (DefaultComposeScripts) landed in0be8f9cabefore the merge. This is the second, and it corrects my reasoning rather than my code.The comment stated a reason that does not hold
git add -uwas justified in-file by "it reads the same population as thegit diff --quietgate above it".That is agreement, and agreement is not correctness. If a consumer's
CHANGELOG.mdwere untracked,git diff --quietandgit add -uwould both see nothing, agree perfectly, and commit an empty tree. The stated reason is satisfied precisely in the case it was supposed to exclude — the same shape as a check whose two sides come from one source.What actually makes it safe
The gate refuses first. Reproduced on a throwaway fixture, untracked changelog, single write:
So an untracked changelog gets a loud refusal, not a silent empty PR — which is the property worth writing down, and it is a different property from the one the comment claimed.
The comment now names three things: that the verb has exactly one write (
os.WriteFile(d.changelogPath, …)inrecover_pending_cut.go; the diff helper writes nothing), so-umisses nothing today; that the refusal is what protects it, not the agreement; and that this line is where it breaks if a second write is ever added to that verb.📌 Why a comment and not just a review reply: whoever adds that second write will read the comment in the file. They will not read the review on a merged PR.
no-changelog: comment text only, zero behaviour change — nothing an adopter could observe in a release note
Scope
Comment text and its
.giteatwin. Zero behaviour change —git add -uis unchanged; only the words above it are.Gates at
bcca836:go test -count=1 ./...rc=0 · bats 98/98 ·register-checkrc=0·fragment-checkrc=0·changelog-body-checkrc=0·check-self-bootstraprc=0·gitea-twin --checkrc=0.The
fragment-checkred on the first head, and why I could not reproduce itbcca836came back 25/2. I reproduced that job's exact invocation locally — sameBASE...HEAD, same threeFRAGMENT_CHECK_*env vars, computed the same way — and gotrc=0. I was reproducing the wrong check. The density/kind check passes; the failure was fragment-coverage, whose input is the PR body, not the tree. No local invocation can exercise it, however exactly the command line matches, because the thing it reads is not in the checkout.Declared above. The gate re-fires on
edited, so this needed no push.📌 A live instance of #498 — "fragment-coverage cannot distinguish forgot from legitimately none" — and the second occurrence today.
⚠️
register-checkcaught my first draft of this comment — I had credited the reviewer by name, which is exactly the chamber-name leak into adopter-facing code that gate exists to stop. Scrubbed to the tracker number; the rationale is unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01DbnWrAAh3iGuPAQF53nuXG
git add -uis safe, not merely consistentApproved at
1410c31ad0f1bb20c474448b38dd03c6e3ed577d. Comment-only, and I verified both halves of the argument against source rather than reading the prose.The control-flow half checks out:
os.ReadFile(d.changelogPath)returns could-not-grade onfs.ErrNotExist, and the onlyos.WriteFilesits downstream of that read — so every write overwrites a path that already existed. The verb cannot create a file.The gate half checks out: the no-change branch errors and exits 1, so the untracked-but-existing residual is a loud named refusal rather than a silent empty PR.
🔑 The reason this is worth a PR of its own: the comment it replaces rested on "the verb writes exactly one tracked file" — a premise that needs re-auditing every time the verb grows. This one rests on control flow and on the gate, and it names the refusal as the property to preserve rather than the
-uflag. Whoever adds a second write to that verb reads this comment and not the review thread that produced it.Original argument @surveyor's, on the PR that introduced the line.