Skip to content
Eskais UI

Git

Commit Graph

The model behind CommitHistory: commits, a one-pass nesting of merged branches under their merge, the rows that show with merges open or closed, git log --graph style lanes laid out lazily, and a commit message parser for file and branch chips.

Example

CommitDepthLaneOut to
Bump version in package.json000
Merge invoice-pdf into main000, 1
Render line items as a PDF table111
Embed fonts in invoice exports111
Add the PDF route in routes.ts110
Fix rounding in proration.ts000
Merge tax-rates into main000, 1
Load EU VAT rates from rates.json110
Create the billing service00—

Installation

npx shadcn@latest add @eskais/commit-graph
Brings alongtonerelative-time

Usage

Import
import {  createCommitGraph,  isMergeRow,  mergeIds,  rowOfCommit,  updateCommitGraph,  visibleRows,} from "@/lib/commit-graph"import { createLaneLayout } from "@/lib/commit-lanes"import {  commitSubject,  createCommitFinder,  parseCommitMessage,  segmentsOf,  subjectPieces,} from "@/lib/commit-message"import { createBranchModel, headTagOf, branchTones } from "@/lib/commit-branches"

Use the model on its own for a graph of your own, or to lay out commits on the server.

API reference

This item exports functions and types rather than components.

Other exports

createCommitGraphisMergeRowmergeIdsrowOfCommitupdateCommitGraphvisibleRowscreateLaneLayoutcommitSubjectcreateCommitFinderparseCommitMessagesegmentsOfsubjectPiecescreateBranchModelheadTagOfbranchTonestype Committype CommitAuthortype CommitGraphtype CommitMessageSegmenttype CommitStatstype CommitStatustype CommitTagtype VisibleRowstype LaneLayouttype LaneLayoutOptionstype LaneRowtype CommitMatchtype BranchInfotype BranchModeltype BranchModelOptionstype BranchStatetype CommitBranch

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.