Expand description
The ladder’s choice of rung before real Git runs.
What:
The ladder around one git worktree add on Linux: the choice of rung before real Git runs, and, after it
returned, the snapshot rung’s steps with a fall back to Git’s own checkout whenever one cannot finish.
Why:
doc/planning/cli-git-btrfs-worktree.md designs it. With a snapshot source Git runs with --no-checkout (branch
validation, administrative files, configuration copy and every message stay Git’s), the wrapper snapshots the source
into a stage name beside the destination, makes it the worktree, applies the difference between the source’s tree
and the new HEAD with git read-tree -m -u, and swaps it into place. Any failure before the swap destroys the
stage and completes the worktree the way Git does, with git reset --hard; the person only ever sees Git’s result.
In TS you’d write (pseudocode):
const ladder = beginLadder(plan, environment);
const git = await runGit(ladder.firstStep());
const result = await ladder.finish(git, runGit);Structs§
- Ladder
- What: The ladder of one invocation. Why: It carries the plan and the chosen rung from before Git to after it.
- Ladder
Result - What: What the ladder tells the lifecycle after Git: Git’s status as the person should see it, and the destination whose ignored state the rung already carried. Why: A snapshot carries the source’s ignored state, so the lifecycle’s own copy skips that destination.
Functions§
- begin_
ladder - What:
Choose the rung for one invocation and prepare it; see
choose_rung. Why: No plan means a form the ladder does not serve, which Git runs as the person wrote it.