Skip to content

A PR title of the form 'word: description' becomes an invalid trailer in GitHub's merge commit #76

Description

@MongLong0214

What happens

GitHub's default merge commit message is the subject Merge pull request #N from owner/branch, a blank line, then the PR title. Git's trailer parser reads the last paragraph as the trailer block.

So a conventional-commits style title turns into a malformed record:

$ commitlore validate --commit 5da3fb2
shape failed · references ok
5da3fb2b3b:3: unknown-key inject — got "inject", want "a key from SPEC §3 or X-<Name>"

The offending line is the PR title I wrote: inject: diagnose silent hook failures on stderr (#67).

The previous merge, ca1f4ce, passes — its title was doctor --fix no longer breaks git fetch (#63), which has no colon in a trailer position. The difference between a valid and an invalid merge commit is whether the human wrote a colon early in the PR title.

Consequence

test/dogfood.test.ts"this repository obeys its own protocol" — now fails on dev, on a commit created by GitHub's merge button. Every merge is a coin flip decided by title style, and word: description is the dominant convention in this ecosystem.

It is the mirror of #75

#75 a real trailer block is not parsed, because a blank line is missing
this prose is parsed as a trailer, because it lands in the last paragraph

Both sit on the prose/trailer boundary that README.md already warns about. Neither is a parser bug — git is behaving as documented in both. What is missing is that the tool never tells anyone which side of the line their text fell on.

Directions

  1. Scope the dogfood test to authored commits. A platform-generated merge commit carries no decision; requiring a record from it is requiring a record nobody wrote. Needs to be an explicit recorded decision, not a silent exclusion — the project has been burned by silent exclusions.
  2. Adopt a PR title convention that cannot parse as a trailer — a mitigation, not a fix, and it depends on every future contributor remembering.
  3. validate distinguishes "a trailer block with a bad key" from "a paragraph that is not a trailer block at all" and says so. This is the real fix and it is the same work as A missing blank line silently discards every record, and the hook says nothing #75 from the other direction.

(1) unblocks CI today. (3) is where it belongs.

Immediate state

dev currently fails its own dogfooding test. That is not a regression in the fix that surfaced it — reference integrity landing on bug-issue-74 is what made validate report shape and reference status separately, which is how the pre-existing violation became visible.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions