Skip to content

WorktreeInput ​

Type, in @jr2/orchestrator/src/worktree.ts. It is an export of @jr2/orchestrator, in the Effects group of the Authoring surface page.

ts
type WorktreeInput =
  | {
      path: AnyWorktreePath;
      branch: string;
      from?: string;
      detach?: never;
      handoff?: never;
      expect?: never;
    }
  | {
      path: AnyWorktreePath;
      detach: string;
      branch?: never;
      from?: never;
      handoff?: never;
      expect?: never;
    }
  | {
      path: AnyWorktreePath;
      handoff: Handoff;
      branch?: string;
      detach?: never;
      from?: never;
      expect?: never;
    };

The input of a worktree(): a branch Worktree, a detached one, or a branch Worktree at a Handoff.

Forms: it is one of these objects.

  • Form 1: path, branch, from, detach, handoff, expect

    • path: AnyWorktreePath

      The root of the Worktree: ${context.workspace.repos.app}/<name>, a constant word.

    • branch: string

      The branch. It resolves as a local branch, then origin/<branch> (tracked), then a new branch.

    • from (optional): string

      Where a new branch starts. Default: the Binding's base. On a branch that exists, it must be that branch's tip, or the cut is refused.

    • detach (optional): never

    • handoff (optional): never

    • expect (optional): never

  • Form 2: path, detach, branch, from, handoff, expect

    • path: AnyWorktreePath

    • detach: string

      The commit to check out, with no branch. The Worktree is forced to it and cleaned on each cut. Ignored files stay, so that a reviewer can run the tests.

    • branch (optional): never

    • from (optional): never

    • handoff (optional): never

    • expect (optional): never

  • Form 3: path, handoff, branch, detach, from, expect

    • path: AnyWorktreePath

    • handoff: Handoff

      The commit of a ready cut of an enclosing Workspace of this run, which this nested Workspace takes (ADR-0080). The cut checks each field against the run's ledger.

    • branch (optional): string

      The branch of the new Worktree. Default: the Handoff's branch. A detached Handoff needs it.

    • detach (optional): never

    • from (optional): never

    • expect (optional): never

The docs of Kit version 0.8.0. Each page is also at its .md URL.