commit-evidence reports OK for a Co-Authored-By trailer that git does not parse

Open
#2,899 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, github
Domain
tooling

Research direction

Start with the commit-evidence tests and implementation in tools/cmd/commit-evidence, then check whether tools/internal/evidence shares that path. Add the reported message cases: reject a Co-Authored-By line outside Git's final trailer paragraph and accept it when a blank line separates it. Run the relevant tests and update the landed-commit-evidence skill to say the trailer must sit alone in the last paragraph.

Written by the indexing model from the issue text.

Description

backlog

Evidence at 65630999e

build/go-tools/commit-evidence (tools/cmd/commit-evidence, run by just land and by the merge-handler's fold) reports commit-evidence: OK for a commit message whose Co-Authored-By trailer git does not parse as a trailer.

Reproduction at the release tip 65630999e: a message with all the evidence sections whose last two lines are

Refs #2894
Co-Authored-By: nevr-builder <[email protected]>

(no blank line between them, the Refs line has no colon). Results:

  • build/go-tools/commit-evidence -file <that message> prints commit-evidence: OK and exits 0.
  • git interpret-trailers --parse < <that message> prints nothing: git reads the last paragraph as prose, so the commit has no Co-Authored-By trailer for git log --format='%(trailers:key=Co-Authored-By,valueonly)' (the check AGENTS.md "Commit identity" tells the author to run after each commit).
  • The same message with a blank line before the trailer: git interpret-trailers --parse prints Co-Authored-By: nevr-builder <[email protected]>.

A builder hit this once (unit 1 of #2894): its first amend passed commit-evidence -rev HEAD with an unparsed trailer; the verify command of AGENTS.md printed an empty trailer column, which is how it was found.

Not shown

  • Whether commit-evidence is meant to check trailer parsing at all (its messages today name a missing co-author line, tools/cmd/commit-evidence): the behaviour above is what the tool does, not necessarily what the skill landed-commit-evidence promises.
  • Whether the land check (tools/internal/evidence) shares the code path.

Falsifier

commit-evidence -file on the message above exits non-zero with a line that names the unparsed trailer, or git interpret-trailers --parse on it prints the co-author line (then the message parses and there is no defect).

Work

  1. A test first: a message whose co-author line is not in git's trailer paragraph is refused (the case above), and the same message with a blank line before the trailer is accepted.
  2. The check reads the trailer the way git does (the last paragraph, Key: value lines only), not by a line match.
  3. Say in the skill landed-commit-evidence that the trailer sits alone in the last paragraph.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.