gites: colorful git tree viewer

Tauri 2 + Vue app that draws the commit graph of the repository given on
the command line. Branches can be hidden one by one or by patterns,
runs of plain commits fold into a dotted line, and everything is
reachable from the keyboard.
This commit is contained in:
2026-10-14 21:11:55 +02:00
commit c05edf7b74
58 changed files with 7716 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
export interface Commit {
hash: string;
short: string;
parents: string[];
author: string;
time: number;
subject: string;
}
export interface Ref {
/** Full name, e.g. `refs/heads/main`. */
name: string;
target: string;
}
export interface RepoData {
root: string;
commits: Commit[];
refs: Ref[];
head_ref: string | null;
head: string | null;
}
export type RefKind = "local" | "remote" | "tag";
export interface FilterRule {
pattern: string;
/** `hide` hides matching refs; `only` shows only refs that match some `only` rule. */
mode: "hide" | "only";
}
export interface FilterState {
/** Full ref names hidden with the eye toggle. */
hidden: string[];
rules: FilterRule[];
}
/** A commit as shown on screen, with its parent edges after collapsing. */
export interface DisplayRow {
commit: Commit;
parents: { hash: string; dotted: boolean }[];
/** Set on the first row of a collapsed run: how many commits are hidden below it. */
hiddenCount?: number;
}
export interface Segment {
/** Column numbers; y is 0 (row top), 0.5 (row middle) or 1 (row bottom). */
x1: number;
y1: number;
x2: number;
y2: number;
color: number;
dotted: boolean;
}
export interface LaidOutRow {
col: number;
color: number;
segments: Segment[];
}