Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Resolve a change request's head on the remote, not the clone

6755b7515c2e3e404e8325eabc0b1e0b74ab901f · Keenan Nemetz · 10d ago · parent 26c9be33

Resolve a change request's head on the remote, not the clone

`change new --head <branch>` resolved the branch in the local clone. A
clone that was behind recorded the old commit, and when that commit was
already in the base the request contained nothing — which is how #117
merged nothing, closed its issue, and left the work on a side branch.

- A branch's head is resolved with `git ls-remote` against the remote the
  metadata write pushes to, so the recorded commit is the forge's tip. If
  local and remote differ, the remote tip is recorded and stderr says so;
  a local-only branch is recorded with a note; `--no-push` may fall back
  to the local ref when the remote cannot be reached.
- A request whose head is already in the base (the same commit, or an
  ancestor) is refused before anything is written, for `change new` and
  `change update --head`. The base is resolved on the remote too: a
  feature worktree commits on its local base branch, so the local base can
  be the head itself and would call every request empty.
- The tag/commit path is unchanged: it still pins the request to that
  commit with no branch.

Tests cover a branch that moved after the clone, a local-only branch, a
head equal to the base, a head that is an ancestor of the base, and the
`change update --head` refusal. The head-resolution note is documented in
docs/change-requests.md.

docs/change-requests.md +7−2

@@ -40,8 +40,13 @@ git push origin feature:refs/heads/main
40 40 ```
41 41
42 42 The request records the branch it follows in `head_ref:` and the commit currently
43 under review in `head:`. The request page, the request list and `vole change show`
44 show both. After every accepted push, Vole moves `head:` to the new tip of the
43 under review in `head:`. A branch is resolved on the remote, not in the local
44 clone: if the clone is behind, the request records the remote tip and says so on
45 stderr, because that is the commit the forge will review and land. A branch that
46 is only local is recorded too, with a note that it is not on the remote yet. A
47 request whose head is already in its base — the same commit, or an ancestor — is
48 refused: it would review nothing. The request page, the request list and
49 `vole change show` show both. After every accepted push, Vole moves `head:` to the new tip of the
45 50 followed branch, so a fixup does not need a second command. Approvals and checks
46 51 still name a commit: the approvals that named the old tip stop counting, and the new
47 52 tip needs its own CI result. An approval is never carried silently to a commit nobody