Fixes #01M5XMWZ310Z7W7N43T997HAQ6.
Why
A change request records the exact commit under review and the page showed only
that: main ← 43f98bcd. The head branch was discarded at creation — the web
form resolved the chosen branch to a commit and passed only the commit to
metadata.NewRequest, and vole change new --head <rev> did the same. So
nothing on the page could say which branch the work was on, which is how people
talk about a change, fetch it, and find it afterwards.
What changed
request.md gains an optional head_ref: beside head::
base: main
head: 43f98bcd93c6ae44d4a7e20f715408d9d324e201
head_ref: contrib/alice/fix-timeout
- Recorded by
CreateChangeRequest(the branch the form offered) and byvole change new --head <branch>when the revision really is a branch tip. A raw commit id, a tag orHEADrecords nothing, and older records load unchanged. - Displayed in the request list’s
Base ← Headcolumn, the request sidebar’sHeadrow, andvole change show(branch: …). - The sidebar marks the branch
(branch moved)or(branch deleted)when it no longer points at the reviewed commit, so the name reads as provenance rather than as a claim that the branch is what is being reviewed.
head_ref is advisory only. metadata.Request.Head remains the commit that
approvals, CI, the diff and landing.Check name; nothing consults HeadRef for
a decision. TestHeadRefIsAHeadingNotAnApproval pins that a request whose
branch has moved cannot authorise the new tip.
The reader validates head_ref leniently — one line, no spaces, not a full ref —
because git is the authority where the branch exists (Repo.ValidBranch at the
writers). Refusing a name git accepts would reject a correctly written request;
the writers still refuse a value git would not call a branch.
Checks
vole workflow check,vole workflow run verify(format, vet, build, govulncheck, packages, links,go test -race ./...).- New tests:
TestHeadRefIsAHeadingNotAnApproval(parse, reject junk, writer round trip, writer refusal, and that the gate ignores the branch), andTestRequestRecordsTheBranchItCameFrom(open with--head feature, read the metadata, see the branch on the request page, the list andchange show, then watch it labelledbranch movedandbranch deleted, and a--head <sha>request recording none). docs/change-requests.mdnotes that the branch is a display hint and the commit is what is reviewed.
Relation to the other open change request
01M5XNBSAGF78RBNXRSSEAXWC9 adds a web control that moves a request’s head. The
two touch different functions; whichever lands second will be rebased. This one
deliberately leaves head_ref as “the branch it was opened from”, so a moved
head shows the recorded branch as moved until the request is re-pointed at a
branch tip.