Git commit history
A git repository's commit history — sha, author, date and message for every commit — from a GitHub URL or a bare owner/repo string.
A git repository's commit history — sha, author, date and message for every commit — from a GitHub URL or a bare owner/repo string. What a commit-history view or a changelog is built from, in one call rather than a page-by-page browse. No repo named yet? Call it on octocat/Hello-World (GitHub's own small public demo repo) to show a caller the shape of the answer, rather than only asking which repo they meant.
Also known as: git, commit history, commit log, git log, git repository commit history, git repository commit history visualization, repo history, who committed what, github commits, list commits, commits
Call it
bowmark.git.commitHistory(repo: string, options?: CommitHistoryOptions): Promise<CommitHistoryResult>Functions
| Function | What it does |
|---|---|
commitHistory | Returns a public GitHub repository's commit log — each commit's sha (full and short), author name and email, author date, message, and its own commit page URL — newest first, GitHub's own… |
Types
interface Commit {
sha: string
shortSha: string // sha's first 7 characters
authorName: string
authorEmail: string
date: string // ISO 8601, the author date
message: string
url: string // the commit's own page on the host
}
interface CommitHistoryOptions {
ref?: string // branch, tag or commit to start from — default branch if omitted
since?: string // ISO 8601 — only commits after this date
until?: string // ISO 8601 — only commits before this date
limit?: number // 1-100, default 30
page?: number // 1-based, for paging past limit
}
interface CommitHistoryResult {
repo: string // resolved as "owner/repo", however it was passed
commits: Commit[]
warnings: string[]
}
type CallOptions = {
timeoutMs?: number // per-provider budget in ms, default 30000, clamped to 1000-55000.
// A provider slower than this is DROPPED from the results and
// NAMED in warnings — never silently absent
}Examples
// No specific repo named? Octocat/Hello-World is GitHub's own small public demo
// repo — pull it to show the shape of a real commit-history answer.
const history = await bowmark.git.commitHistory("https://github.com/octocat/Hello-World", { limit: 10 });
for (const c of history.commits) log(`${c.shortSha} ${c.authorName}: ${c.message.split("\n")[0]}`);// Bare owner/repo works the same as a full URL.
const recent = await bowmark.git.commitHistory("octocat/Hello-World", { since: "2011-01-01T00:00:00Z" });Providers behind it
| Provider | |
|---|---|
github | GitHub |