worktree.list asks each tree one git status --porcelain=v2 --branch, the checkout's branch its upstream for that call, worktree.remove answers a git that refused as merge and discard do, and read_branch says when no branch has finished¶
Decision 851 · accepted · 2026-10-11 · issue #502 · supersedes 840
Superseded in part
In part by 881.
D113 and D105 in docs/developer/defects.md (#502's command mode). Three answers of the
daemon's change; Decision 840's numbers do not. This replaces the calls 840's "Bounded"
names, and nothing else of it.
worktree.list, one status a tree. A linked tree took four git calls (status,rev-list --left-right --count,merge-base,diff --numstat) and the checkout three, each of them two or three processes throughTroupe.Git(Decision 833). Now onegit status --porcelain=v2 --branch --ahead-behind --untracked-files=allsays whether the tree is dirty, names its untracked files (? path, a quoted name still left out), and gives# branch.ab: for the checkout against its upstream, as before; for a linked tree against the checkout's branch, which is its upstream for that one call (-c branch.<name>.remote=. -c branch.<name>.merge=refs/heads/<checkout's>, git's own way of tracking a local branch). The count is taken only when# branch.upstreamnames the checkout's branch: a branch with an upstream of its own keeps it (git adds a merge ref from-c, it does not replace one), and a detached tree or a branch whose name has a=(which-cwould split) gets none, so those are counted withrev-listas before. The lines are onegit diff --numstat --merge-base <checkout's branch>(git 2.30;Troupe.Gitalready needs 2.31), the same diff themerge-basecall fed. So two calls a tree, a third only in those cases.worktree.remove's answers. git's refusal (a directory that is no working tree, one git cannot delete) wasinvalid_paramswithinspectof git's words, quotes and all; it isinternal_errorwith git's words, asworktree.mergeandworktree.discardanswer theirs. A path that is not there isnot_found(kind: worktree), as theirs is, notinvalid_params":not_found"; a git that did not run isinternal_errorinTroupe.Git.explain/1's words. The refusal of a dirty tree isconflict, as it was.read_branchwith none finished. Its listing gave each branch's state and nothing more, which/ask, a branch asked before any other had finished, read as though one had. A listing in which none has finished endsNone of them has finished yet, so there is no summary to read.
Not done here: worktree.merge and worktree.discard still answer a git that did not run
(Troupe.Git's reasons) as invalid_params with an inspected term, through the same
fallback session.create uses for a worktree it cannot make.
Governs: apps/troupe_gateway/lib/troupe/gateway/worktrees.ex, apps/troupe_gateway/lib/troupe/gateway/dispatch.ex, apps/troupe_core/lib/troupe/tools/read_branch.ex