/** * Git reads for `aidlc revert`: is this a branch we may revert on, and which * commits has it made since it left `main`. * * `main` is the base branch the rest of the CLI hard-codes * (`concurrency/worktree.ts`, `autopilot/driver.ts`); merged work on `main` is * out of scope (revert-by-task/AC-22). Every call is `execFileSync` with an * argument array — no shell string ever carries a name from argv. * * Requirements: revert-by-task/AC-2, AC-3, AC-6, AC-9, AC-18, AC-21, AC-22 */ import { type TaskRef } from './trailers.js'; /** One commit in `main..HEAD`. */ export interface BranchCommit { sha: string; short: string; subject: string; /** Parent count; more than one is a merge (AC-9). */ parents: number; /** Tasks named by well-formed `Task:` trailers. */ tasks: TaskRef[]; /** Full shas this commit's message says it reverts (AC-6). */ reverts: string[]; } export type RepoMiss = 'not-a-repo' | 'no-main' | 'on-main' | 'dirty'; export type RepoCheck = { ok: true; branch: string; } | { ok: false; reason: RepoMiss; }; /** Run git in the project root and return stdout; throws on a non-zero exit. */ export declare function git(projectRoot: string, args: string[], input?: string): string; /** * The preconditions every revert needs, in the order the command reports * them: a work tree, a `main` branch, not standing on it, and no uncommitted * change to a tracked file (untracked files cannot be lost by a revert and do * not block it). */ export declare function checkRepo(projectRoot: string): RepoCheck; /** Commits reachable from HEAD and not from `main`, newest first. */ export declare function branchCommits(projectRoot: string): BranchCommit[]; //# sourceMappingURL=commits.d.ts.map