A severed fork rejoins its former parent (#16064)
Undo lasts seven days. After that, an admin of the fork can still follow the former parent again, at any age, as long as that parent exists and they can read it. The fork comes back with the follow mode it had when it was severed (the sever records it); a sever from before that was recorded rejoins with the default mode ("tell me") and says so. Undo restores the recorded mode too, and leaves the mode as it is when none was recorded.
- Web: on a fork that is on its own, the line "On its own since …" shows "Rejoin owner/name" once the Undo window has closed (inside it, only Undo shows). It goes through
/-/confirm, then a POST to/:owner/:name/settings/detach/rejoin; it works without JavaScript. The parent is named only when you can read it; otherwise "Follow upstream again" in Settings is what shows. - Terminal: on the fork's About screen,
Uasks, then rejoins (inside the Undo windowUis the Undo). - MCP:
detachwith{ repo, rejoin: true, confirm: true }; withoutconfirm: trueit only says what it would do. It needs an admin token and is never an agent's. - Refusals are the Undo's: not an admin, an agent, a repack running, the parent gone or unreadable.
- The parent, the mode and the
repo.reattachedevent are set in one guarded step: if it throws, the git link is undone and the error surfaces, so the fork is not left half-rejoined. - Code:
rejoinParentinsrc/actions/sever_undo.ts; tests intest/fork-rejoin.test.tsandtest/fork-rejoin-doors.test.ts.