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:
- fetch
<remote>/<branch>; call its tipT; - if
Tis not already in the branch,git merge --no-commit T(with whatever merge driver the repository configures) and run the working-tree gate ofcrate::landover 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; - every other merge commit between
Tand 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; --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/configdefault) runssem 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);- 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
--ontowas asked to do. - Refusal
- Why
preparerefused, 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 infiles.- land_
onto - Land the current branch onto
opts.remote/opts.branch. Progress and every refusal go toout, 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 indir: mergetipin 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 ontip.envis extra environment for the verify command. - recorded_
check - The sem check document recorded for
treeindir’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-mergeas 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.