// What the server sends the view. import type { FileDiff } from "./patch.ts"; export type { FileDiff, Hunk } from "./patch.ts"; /** An id as jj shows it: the shortest unique prefix, then a few more characters. */ export type Id = { full: string; prefix: string; rest: string }; /** A commit, or jj's change, in the log. */ export type Revision = { /** What the view's route names it by: jj's change id or git's commit hash, or `""` for the working copy. */ route: string; /** jj's change id. */ change: Id | null; /** `null` for git's working tree, which is not one yet. */ commit: Id | null; description: string; author: { name: string; email: string; timestamp: string } | null; /** Bookmarks, branches and tags at it. */ refs: string[]; workingCopy: boolean; empty: boolean; immutable: boolean; conflict: boolean; }; /** A file's change as it is sent: left out, but for its key, when the view has it already. */ export type Sent = { key: string; diff: FileDiff | null }; /** A repository's recent history, and one revision's changes. */ export type Shown = { vcs: "jj" | "git"; root: string; /** From the working copy back. */ log: Revision[]; revision: Revision; files: FileDiff[]; /** Untracked files in git's working tree past those shown. */ omitted: number; }; /** What the view is sent: what it shows, but each file's change only if it did not have that already. */ export type Reply = Omit & { files: Sent[] };