Skip to main content

Module worktree_slow_route

Module worktree_slow_route 

Source
Expand description

The plain sentence that says why an add was not made as a snapshot, and where it goes. What: The plain sentence that tells a person why a git worktree add was not made as a snapshot, and the places it goes: one line on standard error unless --quiet was given, one warning entry in the journal, and the debug log that already holds the detail. Why: A snapshot of the main checkout takes seconds and Git’s checkout with the ignored-state copy takes minutes. The choice between them was made silently, so two slow adds could not be explained afterwards. The sentence names the cause in the person’s words (a change, a running Git command, a stale index, a missing subvolume) and what makes the next add quick, without the names of the ladder’s steps. A filesystem that is not btrfs gets no sentence: nothing the person does there would make the add a snapshot, so the line would only repeat itself.

In TS you’d write (pseudocode):

const route = explainRefusal({ context, identity, refusal });
route?.tell(plan); // stderr unless quiet, and the journal

Structs§

SlowRoute
What: What kept the add from being a snapshot, as a sentence for the person and a word for the journal. Why: One sentence and one word per cause, chosen by what the cause is and never by the ladder’s step that found it.

Constants§

LEAD
The start of the line on standard error and of the journal message; the cause and the remedy follow.

Functions§

explain_cheap_refusal
What: The sentence for the cheap refusals (the source is no subvolume, or the two sides are not on one filesystem), or nothing where the filesystem is not btrfs. Why: On a btrfs source that is no subvolume the person can convert it; on another filesystem nothing makes the add a snapshot, and a line on every add would be noise.
explain_failure
What: The sentence for a snapshot that started and could not be finished. Why: The add is whole, made by Git’s checkout; the sentence says why the quick way ended, in the check’s own words.
explain_refusal
What: The sentence for a source the expensive checks refused, or nothing when no sentence would help. Why: The kind of the refusal chooses between the unclean sentence, which reads Git’s status, and the plain statement of an unsupported feature.
explain_unsupported
What: The sentence for a feature of the source that a snapshot does not reproduce. Why: These reasons are already plain statements (“core.sparseCheckout is set”); the sentence adds nothing to them, and names no remedy because the person’s choice of feature is not the wrapper’s to undo.