import type { RepositoryRow } from "../../db/index.ts"; import { formatDateTime } from "../../lib/formatDate.ts"; import type { SessionUser } from "../../middleware/session.ts"; import type { CommitEntry } from "../../services/git.ts"; import { Layout } from "../layout.tsx"; import { RepoHeader } from "../repos/RepoHeader.tsx"; import { BranchSelector } from "./BranchSelector.tsx"; import { RepoNav } from "./RepoNav.tsx"; interface CommitLogProps { user: SessionUser | null; repo: RepositoryRow; ref: string; commits: CommitEntry[]; branches: string[]; tags?: string[]; /** URL for the next (older) page, or null if this is the last page. */ olderUrl: string | null; /** URL for the previous (newer) page, or null if this is the first page. */ newerUrl: string | null; } export function CommitLog({ user, repo, ref: logRef, commits, branches, tags, olderUrl, newerUrl, }: CommitLogProps) { return (

Commits

{commits.length === 0 ? (

No commits yet.

) : ( <>

Note: To verify signed commits locally, download the{" "} allowed signers file{" "} and run:{" "} git -c gpg.format=ssh -c gpg.ssh.allowedSignersFile=allowed_signers verify-commit <hash>

    {commits.map((c) => (
  • {c.subject}
    {c.author} {c.sigStatus === "good" && ( verified )} {c.sigStatus === "bad" && ( unverified )} {c.hash.slice(0, 7)}
  • ))}
)} {(!!newerUrl || !!olderUrl) && ( )}
); }