Expand description
Taking a branch over from an earlier attempt at the same task.
A retried task can reopen a branch (magi/f82f/A) that the previous
run still has checked out in its own worktree. Git holds a branch in one
worktree at a time, so the new run’s review cannot start, and the only way
forward used to be an agent asking the operator whether the old worktree
may be deleted. Auto-fold cannot help: it only folds terminal runs, and an
unfinished run keeps its worktrees on purpose so it can be resumed.
When the run holding the branch is one this attempt supersedes
(crate::queue::Task::earlier_attempts), nothing is left to resume it
into, so its worktree - and only its worktree - is released before the
review starts. The branch, every commit and any pull request stay
exactly where they were.
decide is pure; release is the only function here that touches git
or disk. Only a queue-driven review takes over anything: a hand-run
magi review has no task, so it carries no Takeover and behaves as it
always did.
Structs§
- Holder
- What is known about the run and worktree holding the branch.
- Refused
- The operator has to decide: the takeover was refused, and the text says why.
- Released
- A worktree that was released, with what is needed to put it back if the review that took the branch over never starts.
- Takeover
- The earlier attempts at a task a new run may take a branch over from.