diff --git a/docs/re/METHOD.md b/docs/re/METHOD.md index b32cfc65..f87207a8 100644 --- a/docs/re/METHOD.md +++ b/docs/re/METHOD.md @@ -2729,3 +2729,23 @@ quiet one.** A wrong answer gets noticed. A check that can only ever say "fine" reported as passing forever, and its output *looks* like evidence. ⚠️ Printing a verdict is not asserting it — the exit code is the assertion, and it is the part nobody reads until it matters. + +## Backticks in a double-quoted commit message are command substitution + +`sylpheed-port` reported three backticked words eaten out of one of their commit +messages, and named the property that makes it dangerous: **a dropped noun leaves +grammar intact**, so the sentence still parses and nothing looks wrong. + +🔴 **It then happened to me, in the commit message describing that class of +defect.** `git commit -m "... a \`return 0\` swallowed the band verdict ..."` +executed the backticked text and spliced in the empty result. The body now reads +*"a swallowed the verdict"* — three words gone, still grammatical. + +⚠️ The message was already pushed, and rewriting shared history is forbidden, so +it is corrected by a following empty commit rather than an amend. **A wrong commit +message cannot be fixed in place** — which makes this cheaper to prevent than any +of the other traps on this page. + +📌 Use a heredoc (`git commit -F -`) or single quotes for any message containing +backticks. This page is full of identifiers in backticks, so the exposure is +constant.