╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#825bf9bb5362d56510ff68884966bf8e85bf3d1c",│ │ 7 - .hash = "xit-0.0.0-Ub3nDJijUAEGb6FVX-srDVZi6SQBnbPGPl_5sJ87hB0-", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#88d5a7c76821ab3ba2d0f12d63b19a50ea4119ac",│ │ 7 + .hash = "xit-0.0.0-Ub3nDPq4UAF37IEfwRDygXKqb3s5uog7SpVkuA-bD5UZ", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭─────────────────────────────────────╮ │72 comment: ?Comment, │ │73 }; │ │74 │ │75 +// who a commit is attributed to │ │76 +pub const CommitAuthor = struct {│ │77 + name: []const u8, │ │78 + email: []const u8, │ │79 +}; │ │80 + │ │81 pub const EventWithId = struct { │ │82 id: [event_id_size * 2]u8, │ │83 event: Event, │ ╰─────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │84 timestamp: u64 = 0, // not serialized, because it comes from the commit timestamp │ │79 - author_email: []const u8, // not serialized, because it goes in the commit author │ │85 + author: CommitAuthor, // not serialized, because it goes in the commit author line│ │86 │ │87 pub fn jsonStringify(self: EventWithId, jw: anytype) !void { │ │88 try jw.beginObject(); │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────╮ │107 return .{ │ │108 .id = json_event.id, │ │109 // unused when reading; the author lives in the commit│ │104 - .author_email = "", │ │110 + .author = .{ .name = "", .email = "" }, │ │111 .event = switch (json_event.kind) { │ │112 .user => .{ │ │113 .user = if (json_event.data) |value| │ ╰───────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │351 json.clearRetainingCapacity(); │ │352 try std.json.Stringify.value(event, .{}, &json.writer); │ │353 if (json.written().len > max_event_size) return error.EventTooLarge; │ │348 - const author = try std.fmt.allocPrint(allocator, "haxy <{s}>", .{event.author_email}); │ │354 + const author = try std.fmt.allocPrint(allocator, "{s} <{s}>", .{ event.author.name, event.author.email }); │ │355 defer allocator.free(author); │ │356 _ = try obj.writeCommit(repo_kind, repo_opts, state, io, allocator, .{ .author = author, .message = json.written(), .timestamp = event.timestamp, .parent_oids = parent_oids }, null, ref);│ │357 // later events parent on the ref's new tip │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │1234 try consume(.xit, admin_repo_opts, io, allocator, &repo, events_ref, &[_]EventWithId{.{│ │1235 .id = event_id_hex, │ │1236 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │1231 - .author_email = owner.event.email, │ │1237 + .author = .{ .name = owner.event.name, .email = owner.event.email }, │ │1238 .event = .{ .repo = .{ │ │1239 .user_id = &owner_user_id, │ │1240 .name = repo_name, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ────────────╮ │src/event/Comment.zig│ ╰─────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │115 thread_id: *const [evt.event_id_size * 2]u8, │ │116 parent_id: *const [evt.event_id_size * 2]u8, │ │117 body: []const u8, │ │118 - author_email: []const u8, │ │118 + author: evt.CommitAuthor, │ │119 ) ![evt.event_id_size * 2]u8 { │ │120 if (!fieldsValid(body)) return error.InvalidFields;│ │121 │ ╰────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │125 try evt.consume(repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{.{│ │126 .id = event_id, │ │127 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │128 - .author_email = author_email, │ │128 + .author = author, │ │129 .event = .{ .comment = .{ │ │130 .thread_id = thread_id.*, │ │131 .parent_id = parent_id.*, │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────╮ │146 thread_id: *const [evt.event_id_size * 2]u8, │ │147 comment_id: *const [evt.event_id_size]u8, │ │148 body: []const u8, │ │149 - author_email: []const u8, │ │149 + author: evt.CommitAuthor, │ │150 ) !void { │ │151 if (!fieldsValid(body)) return error.InvalidFields;│ │152 │ ╰────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │170 try evt.consume(repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{.{│ │171 .id = std.fmt.bytesToHex(comment_id.*, .lower), │ │172 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │173 - .author_email = author_email, │ │173 + .author = author, │ │174 .event = .{ .comment = updated }, │ │175 }}); │ │176 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯