From 32ad6cab8d58d99ebd8a28e8fa6e6f4e587cb1e5 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 17 Mar 2026 23:19:43 -0500 Subject: v1.0 --- Hutch/Models/CommitSummary.swift | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Hutch/Models/CommitSummary.swift (limited to 'Hutch/Models/CommitSummary.swift') diff --git a/Hutch/Models/CommitSummary.swift b/Hutch/Models/CommitSummary.swift new file mode 100644 index 0000000..88c3e7d --- /dev/null +++ b/Hutch/Models/CommitSummary.swift @@ -0,0 +1,22 @@ +import Foundation + +/// Lightweight commit model for list views. Matches the subset of fields +/// returned by the repository log query. +struct CommitSummary: Codable, Sendable, Identifiable, Hashable { + let id: String + let shortId: String + let author: CommitAuthor + let message: String + + /// First line of the commit message. + var title: String { + message.prefix(while: { $0 != "\n" }).trimmingCharacters(in: .whitespaces) + } +} + +/// A compact author representation used in commit list responses. +struct CommitAuthor: Codable, Sendable, Hashable { + let name: String + let email: String? + let time: Date +} -- cgit v1.2.3