Put the closing keyword where Gitea will actually read it #100

Closed
opened 2026-08-18 21:12:44 +00:00 by yonlu · 1 comment
Owner

CLAUDE.md tells you to close issues by hand because the Closes line is unreliable. It is unreliable for a specific, fixable reason, and the rule should say what actually works rather than only what does not.

What was measured

Gitea parses commit messages that land on the default branch. It does not parse the PR body. The body only matters if it is copied into the merge commit message, which depends on how the merge is performed.

Two merges, two outcomes:

  • #83 — its merge commit 3c3197d carried Closes #9, #13, #14, #19, #26, #29, #33, #35, #37, #41. into the commit message. Gitea parsed it and closed five of the ten. A comma-separated list is only partially matched.
  • #93 — its merge commit 2013939 body is only Reviewed-on: https://…/pulls/93. The PR body never reached a commit message, so there was nothing to parse and #92 stayed open despite a correct Closes line in the PR description.

So there are two independent failure modes: the keyword may never reach a commit at all, and a comma list drops most of its references even when it does.

The rule that follows

Put the keyword in the commit body as a footer, one issue per line:

docs: delete four documents that contradict the code

<body>

Closes #98

This is compatible with everything already load-bearing here. Conventional Commits allows footers; scripts/commit-check.sh only regexes the subject line; and semantic-release reads the type from the subject, so a footer changes no release decision.

The existing guidance was right that the issue number does not belong in the subject — that reasoning does not extend to the body, which is what actually reaches main.

Verify anyway. A squash, or a merge message edited by hand at merge time, can still drop the footer. The check is one command: ./scripts/issue.sh list --state open, looking for anything just shipped.

Done when

CLAUDE.md states the footer form, the one-per-line rule and the verification step, and the next merge closes its issue without anyone touching it.

CLAUDE.md tells you to close issues by hand because the `Closes` line is unreliable. It is unreliable for a specific, fixable reason, and the rule should say what actually works rather than only what does not. ## What was measured **Gitea parses commit messages that land on the default branch. It does not parse the PR body.** The body only matters if it is copied into the merge commit message, which depends on how the merge is performed. Two merges, two outcomes: - **#83** — its merge commit `3c3197d` carried `Closes #9, #13, #14, #19, #26, #29, #33, #35, #37, #41.` into the commit message. Gitea parsed it and closed **five of the ten**. A comma-separated list is only partially matched. - **#93** — its merge commit `2013939` body is only `Reviewed-on: https://…/pulls/93`. The PR body never reached a commit message, so there was nothing to parse and **#92 stayed open** despite a correct `Closes` line in the PR description. So there are two independent failure modes: the keyword may never reach a commit at all, and a comma list drops most of its references even when it does. ## The rule that follows Put the keyword in the **commit body as a footer**, one issue per line: ``` docs: delete four documents that contradict the code <body> Closes #98 ``` This is compatible with everything already load-bearing here. Conventional Commits allows footers; `scripts/commit-check.sh` only regexes the subject line; and semantic-release reads the type from the subject, so a footer changes no release decision. The existing guidance was right that the issue number does not belong in the **subject** — that reasoning does not extend to the body, which is what actually reaches `main`. **Verify anyway.** A squash, or a merge message edited by hand at merge time, can still drop the footer. The check is one command: `./scripts/issue.sh list --state open`, looking for anything just shipped. ## Done when CLAUDE.md states the footer form, the one-per-line rule and the verification step, and the next merge closes its issue without anyone touching it.
yonlu added the Kind/Documentation
Priority
Medium
3
labels 2026-08-18 21:12:44 +00:00
yonlu self-assigned this 2026-08-18 21:12:59 +00:00
yonlu added the
Status
In Progress
label 2026-08-18 21:13:00 +00:00
Author
Owner

Starting work on this on docs/retire-stale-planning-docs.

Starting work on this on `docs/retire-stale-planning-docs`.
yonlu closed this issue 2026-08-18 21:30:35 +00:00
yonlu removed the
Status
In Progress
label 2026-08-18 21:31:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yonlu/yellowjacket#100