method: backticks in a double-quoted commit message are command substitution
Second instance across two agents, and mine landed in the message describing the defect class itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user