Expand description
Deciding what a local branch and its remote twin mean when both moved.
A run’s branch can be rewritten on one side only: magi rebases it locally
(a retry, a fixer) and, until this module, never pushed the result, so the
next attempt found refs/heads/<b> and <remote>/<b> diverged - the same
change on two different bases. Picking the remote side there silently
discards the rebase; picking the local one discards whatever a person
pushed. classify therefore only lets magi settle the question when it
can prove nothing is lost, and otherwise hands both sides to the operator
as a Diverged that says what each one carries.
The proof is patch-id, via git cherry: two commits that apply the same
diff are the same change on different bases. A merge, a squash or a rebase
that needed conflict resolution changes the patch-id and is therefore
Divergence::Genuine - the safe side of every doubt.
Structs§
- Choice
- The owner’s answer to a divergence question, with the tips they were shown.
- Commit
- One commit on one side of a divergence.
- Diverged
- A divergence magi could not settle by itself.
- Stale
- The owner’s answer described tips that no longer exist: nothing was done.
Enums§
- Divergence
- What a divergence turned out to be.
- Reconciliation
- What
reconciledid. - Side
- What the owner chose.
Constants§
- NODE
- Node the daemon records on the divergence question (
daemon’sDivergedarm). There is no agent behind it, socrate::deputy::destructivenames it. - SEAT
- Seat recorded on the divergence question, with
NODE.
Functions§
- apply_
choice - Carry out the owner’s decision, but only against the tips they were shown.
- classify
- Classify a divergence between
localandorigin(both shas). - origin_
missing - What
originhas that nolocalcommit repeats: patchesgit cherryfinds unmatched, plus every merge, whichgit cherrycannot see and which may carry conflict resolutions or other content of its own. - reconcile
- If
localis provablyorigin’s change rebased, push it with a lease pinned tooriginand say so;Ok(false)when it is not. - summary_
for - The question summary for
branchonremote.