import type { FlagView } from '../../../spec/types.ts'; import { type CommitFacts, type LogFormat } from './format.ts'; import { type Repo } from './repo.ts'; /** The parsed shape of a `git log` invocation. */ export interface LogFlags { /** `-n`, how many commits to print. */ readonly maxCount: number | null; /** `--oneline`, one abbreviated row per commit. */ readonly oneline: boolean; /** `--reverse`, oldest first. */ readonly reverse: boolean; /** `-S`, the pickaxe string. */ readonly search: string | null; /** `--since` as an epoch second. */ readonly since: number | null; /** `--until` as an epoch second. */ readonly until: number | null; /** `--all`, start from every ref as well. */ readonly allRefs: boolean; /** * How each commit renders; medium unless `--oneline` or * `--pretty`/`--format` said otherwise. */ readonly pretty: LogFormat; /** * Print abbreviated ids, which `--oneline` implies and * `--pretty=oneline` alone does not. */ readonly abbrevCommit: boolean; } /** * The --pretty/--format value, honoring the bare optional form. * * Both spellings set the same variable in git; `--format` is read first when * both appear on one line, an ordering the flag bag cannot preserve. A bare * `--pretty` means medium, git's own default, but pretty.c reads `--format` * only in its =value form, so the bare spelling gets git's own fatal * (pinned: 2.37 and 2.54, exit 128). */ export declare function prettyValue(fl: FlagView): string | null; /** Read the raw log flag kwargs into a frozen struct. */ export declare function parseFlags(fl: FlagView): LogFlags; /** Every commit a ref points at, tags peeled, for `--all`. */ export declare function refCommits(repo: Repo): Promise; /** * Ref labels per commit, in the order git prints them. * * git walks refs alphabetically and prepends each label, so a commit's labels * read in reverse ref order; HEAD is pulled to the front, spelled * `HEAD -> branch` when attached (the branch's own label is absorbed) and * `HEAD` alone when detached. Pinned against git 2.50. */ export declare function decorations(repo: Repo): Promise>; /** * The commits a log invocation prints, in the order it prints them. * * Order of operations is git's: walk history, drop what the filters reject, cut * to `-n`, and only then reverse. Reversing last is what makes * `-S --reverse` name the commit that introduced a string rather than the * most recent one to touch it. * * @param repo repository to walk * @param starts the commits to walk back from; more than one when `--all` * seeds every ref * @param flags the parsed invocation */ export declare function select(repo: Repo, starts: readonly CommitFacts[], flags: LogFlags): Promise; //# sourceMappingURL=history.d.ts.map