Skip to main content

Module onto

Module onto 

Source
Expand description

weave land --onto <remote>/<branch> — the whole landing: bring the branch’s latest commits onto a shared branch, and publish nothing that has not been checked against the exact commit it is published onto.

The loop, at most attempts times:

  1. fetch <remote>/<branch>; call its tip T;
  2. if T is not already in the branch, git merge --no-commit T (with whatever merge driver the repository configures) and run the working-tree gate of crate::land over the merge in progress — conflicted files AND files the driver or git merged cleanly. Every file must come out PROVEN or VERIFIED (DROPPED / UNDELETED included); then the merge is committed. Otherwise the merge is left in progress with the refused files conflicted, and nothing is published;
  3. every other merge commit between T and HEAD not yet checked (one the agent committed itself) is checked the same way, its own tree as the answer (revisions mode, --result) — and a file it refuses gets a second hearing as HEAD holds it now, so a later fix commit counts;
  4. --verify-cmd, when given, runs on the final tree (a build, the affected tests); a non-zero exit refuses; then --check sem (or the .weave/config default) runs sem check --base <T> on it: any verdict but pass — fail, could not decide, no sem installed — refuses, and the diagnostics are the refusal’s report (crate::semcheck);
  5. a fast-forward-only update of <branch> on <remote>. When it is rejected, the branch moved: back to 1 — the new merge is gated again, and the verify command runs again on the new tree.

The default is to refuse: no step’s failure leads to publishing.

Checked merges are remembered by commit id in <git-dir>/weave-land-verified (a commit id fixes both parents and the tree, so the verdict cannot go stale), and verify passes by tree and command in <git-dir>/weave-land-verify-ok, so a retry does no work twice.

Structs§

Options
What --onto was asked to do.
Refusal
Why prepare refused, in a form another process can act on.

Enums§

Gated
How [gate_merge_in_progress] ended.
Outcome
How the run ended.
Prep
A tree ready to publish, or why not.

Functions§

check_resolution
The merge in progress in dir: the person’s in-place resolution, judged with the working-tree gate and the both-sides invariant and committed when it passes — or land’s own unfinished merge, aborted (never judged as a resolution). true: go on (committed, or aborted cleanly).
conflict_regions
path:first-last (1-based) for every conflict block still in files.
land_onto
Land the current branch onto opts.remote/opts.branch. Progress and every refusal go to out, in words meant for the person (or agent) who has to act on them.
prepare
Steps 2–4 of the loop against one fetched tip, on the branch checked out in dir: merge tip in and gate every file of the merge, gate every other unchecked merge on the branch, run the verify command on the final tree. Ready(HEAD) when all of it passed — the caller publishes HEAD with a lease on tip. env is extra environment for the verify command.
recorded_check
The sem check document recorded for tree in dir’s git dir, if any.
split_target
remote/branch → (remote, branch).
start_merge
Start land’s own merge of tip (git merge --no-commit --no-ff), recorded in <git-dir>/weave-land-merge as in-flight first. Ok(Err) (the reason; the report printed) when git did not complete the merge — it could not write the index, say — in which case whatever it left is aborted: a merge git did not finish is never judged as a merge.