Where the note gets lost#
Ana records a QA result on a commit and pushes the branch:
git notes add -m "QA: passed on staging"
git push origin main
Ben clones. git log shows the commit and no note, and git notes show HEAD prints error: no note found for object 215b007.... Nothing in the clone says that a note exists elsewhere.
There are three separate gaps, each reproduced with Git 2.43:
| Step | Default | What carries it |
|---|---|---|
| Ana pushes a branch | Notes stay local | git push origin refs/notes/commits |
| Ben clones or fetches | Notes are not fetched | git fetch origin 'refs/notes/*:refs/notes/*' |
| Ana amends the commit | The new commit has no note | git config notes.rewriteRef refs/notes/commits |
Ben's fetch returned nothing until Ana ran her push. With the rewrite setting, an amended commit kept its note. After both, git notes show HEAD printed the text. Notes live under refs/notes/commits, outside the branches that a normal push and fetch cover. The git notes manual describes the ref and the rewrite settings.
The third gap also covers a squash merge: the server makes a new commit, and the note stays on the old one.
Choose where the evidence lives#
| Evidence | Place | Why |
|---|---|---|
| A fact that should stay with the change, such as who tested it | Commit trailer | It is part of the commit, so every clone has it |
| A result that arrives after the commit is shared | Pull request comment or check | Adding a trailer would change the commit |
| A large log or recording | A stored file, with its hash in one of the above | Neither place is meant for files |
| Annotations your own tooling reads | Notes, with the push and fetch configured | Nothing is rewritten, and the team opts in |
A trailer is one line at the end of the message, and Git can add it:
git interpret-trailers --trailer 'Tested-by: Ben <ben@example.com>' < message.txt
A trailer names a person and a claim. It carries no proof, so write what was tested in the body: the build, the command and the result.
What the receiver checks#
git ls-remote origin 'refs/notes/*' lists notes on the server without fetching them. Empty output means that this remote holds none under that prefix. It does not show that nobody wrote one, because an unpushed note exists only in its author's clone. If a message promises a note and the command prints nothing, ask for the push.
Worked example#
This example is fictional. A release engineer reads git log for the commits in a release and finds no test evidence on four of nine. The QA engineer had used notes on all nine. git ls-remote shows the notes ref, so it was pushed, and a fetch brings in five. The other four belonged to commits that were amended during review. The team moves the result into the pull request, where the squash merge cannot detach it, and the release engineer holds the four changes until the results are matched to the merged trees.
Matching a tested tree to a squash merge is the next step in that story. Handing over evidence lists the rest.