export { extractChangedFiles, filterDiffByPatterns, getDefaultBranch, getGitBranch, getGitBranchDiff, getGitDiff, getGitDiffRange, getGitDiffStat, getGitLogSince, getGitStatus, getLatestTag, getTagDate, isFileDirty, resolveGitRoot, } from '@mmnto/totem';
/**
 * Check if `base` is an ancestor of `head` (or HEAD if omitted).
 * Returns true if `git merge-base --is-ancestor` exits 0.
 */
export declare function isAncestor(cwd: string, base: string, head?: string): boolean;
/**
 * Get shortstat between two refs. Returns parsed line counts.
 */
export declare function getShortstat(cwd: string, base: string, head?: string): {
    files: number;
    insertions: number;
    deletions: number;
};
/**
 * Get file statuses between two refs. Returns array of { status, file }.
 * Status is 'A' (added), 'M' (modified), 'D' (deleted), etc.
 */
export declare function getNameStatus(cwd: string, base: string, head?: string): Array<{
    status: string;
    file: string;
}>;
/**
 * Get the diff between two refs.
 */
export declare function getDiffBetween(cwd: string, base: string, head?: string): string;
export type DiffForReviewSource = 'explicit-range' | 'staged' | 'uncommitted' | 'branch-vs-base';
export interface DiffForReviewOptions {
    staged?: boolean;
    /** Explicit ref range (mmnto-ai/totem#1717). When set, bypasses the implicit fallback chain. */
    diff?: string;
    /**
     * Force the branch-vs-base (push-gate) diff scope regardless of working-tree
     * state (mmnto-ai/totem#2091). Mutually exclusive with `staged` and `diff`.
     */
    branch?: boolean;
    /**
     * Explicit base branch NAME for the forced branch-vs-base scope
     * (mmnto-ai/totem#2091). Resolved through `getGitBranchDiff`'s
     * origin-preference logic (`origin/<base>...HEAD`, else local `<base>` —
     * mmnto-ai/totem#2054); NOT a raw ref range. Setting `base` implies
     * `branch`. Mutually exclusive with `staged` and `diff`.
     */
    base?: string;
    /**
     * Lint-only opt-in for the narrow-scope advisory (mmnto-ai/totem#2090).
     * When the resolved source is `staged`/`uncommitted` and the branch-vs-base
     * scope the pre-push gate checks would cover more files, a one-line warning
     * names the gap. Never set by `review` — staged-slice review is routinely
     * intentional (truncation-cliff workaround), so warning there trains ignore.
     */
    warnNarrowScope?: boolean;
}
export interface DiffForReviewConfig {
    ignorePatterns: string[];
    shieldIgnorePatterns?: string[];
}
export interface DiffForReviewResult {
    diff: string;
    changedFiles: string[];
    /** Which path produced the diff (mmnto-ai/totem#1717 — surfaced for operator-visible logging). */
    source: DiffForReviewSource;
}
/**
 * Maximum diff size (in characters) before the prompt assembler truncates.
 * Mirrored from `shield-templates.MAX_DIFF_CHARS` so the resolution-layer
 * warning fires on the same threshold as the actual truncation site.
 *
 * Kept as a separate constant here rather than imported from
 * `commands/shield-templates.ts` to avoid a circular CLI dependency
 * (`git.ts` is intended to be substrate for many commands, not just review).
 */
export declare const REVIEW_DIFF_TRUNCATION_THRESHOLD = 50000;
/**
 * Shared diff-fetching logic used by both `shield` and `lint` commands.
 *
 * Resolution order:
 *   1. `--branch` / `--base <ref>` (forced push-gate scope, mmnto-ai/totem#2091 —
 *      jumps straight to the branch-vs-base diff of step 4, ignoring the
 *      working tree; mutually exclusive with 2 and 3)
 *   2. `--diff <range>` (explicit, no fallback)
 *   3. `--staged` (staged-only) or working-tree (`all`) diff
 *   4. Branch-vs-base diff (`<default>...HEAD`) when 3 yields nothing
 *
 * The chosen resolution path is logged to stderr (mmnto-ai/totem#1717) so the operator's
 * mental model matches the actual git invocation. Diffs exceeding
 * `REVIEW_DIFF_TRUNCATION_THRESHOLD` chars surface a warning here, before
 * the LLM call is made, so the operator can re-run with a narrower
 * `--diff <range>` instead of paying for a degraded review.
 *
 * Returns `null` when no changes are detected.
 */
export declare function getDiffForReview(options: DiffForReviewOptions, config: DiffForReviewConfig, cwd: string, tag: string): Promise<DiffForReviewResult | null>;
//# sourceMappingURL=git.d.ts.map