╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────╮ │src/ui/Fork.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │127 .id = &id_hex, │ │128 } }; │ │129 const files = try Files.init(.xit, .{}, arena, &fork_repo, io, arena.child_allocator, location, requested_ref, requested_value, files_path, files_line); │ │130 - var commits = try Commits.init(.xit, .{}, arena, &fork_repo, io, arena.child_allocator, haxy_moment, location, requested_ref, requested_value, commits_content, commits_base_oid); │ │130 + var commits = try Commits.init(.xit, .{}, arena, &fork_repo, io, arena.child_allocator, haxy_moment, location, requested_ref, requested_value, commits_content, &commits_base_oid);│ │131 commits.commit_count = if (newest_revision) |revision| revision.record.commit_count else 0; │ │132 const diff_start: usize = switch (route) { │ │133 .fork_diff => |d| d.start, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │83 .repo_commits => |c| c.content, │ │84 else => .{ .diff = .{} }, │ │85 }; │ │86 + const commits_base_oid: []const u8 = switch (route) { │ │87 + .repo_commits => |*c| c.base_oid.slice(), │ │88 + else => "", │ │89 + }; │ │90 // the refs tab windows one column at a time: `refs_from` (a url-encoded │ │91 // ref name) roots `refs_kind`'s column, the other stays at its first window.│ │92 const refs_kind: ui.RoutablePage.RefKind = switch (route) { │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │242 const target_branch = if (files_data.ref_or_oid == .branch) files_data.ref_or_oid_value else ""; │ │243 break :blk .{ │ │244 files_data, │ │241 - try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, session.haxy_moment, location, requested_ref_or_oid, requested_ref_value, commits_content, null), │ │245 + try Commits.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, session.haxy_moment, location, requested_ref_or_oid, requested_ref_value, commits_content, commits_base_oid), │ │246 try Refs.init(repo_kind, opened.self_repo_opts, arena, opened, io, gpa, repo_identity.identity, refs_kind, refs_from), │ │247 try Issues.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view), │ │248 try Patches.init(repo_kind, opened.self_repo_opts, arena, opened, io, session.haxy_moment, session, repo_id_maybe, repo_identity.identity, target_branch, patches_tag, patches_selected, patches_comment, patches_comments_start, patches_theirs, patches_view),│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │257 const aa = arena.allocator(); │ │258 break :blk .{ │ │259 try Files.emptyResult(aa, location, requested_ref_or_oid orelse .branch, requested_ref_value, files_dir), │ │256 - try Commits.emptyResult(aa, location, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content), │ │260 + try Commits.emptyResult(aa, location, requested_ref_or_oid orelse .branch, requested_ref_value, commits_content, commits_base_oid), │ │261 try Refs.emptyResult(arena, repo_identity.identity, refs_kind, refs_from), │ │262 try Issues.emptyResult(aa, repo_identity.identity, issues_tag, issues_selected, issues_comment, issues_comments_start, issues_theirs, issues_view), │ │263 try Patches.emptyResult(aa, repo_identity.identity, patches_tag, patches_selected, patches_comment, patches_comments_start, patches_theirs, patches_view),│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │301 // build the header first so we can grab the files-tab id for the auth │ │302 // view (it focuses there after login). │ │303 { │ │300 - var header_view = try Header.View.init(allocator, &data.header, data.commits.commit_count, session); │ │304 + var header_view = try Header.View.init(allocator, &data.header, data.commits.commit_count, data.commits.base_oid, session); │ │305 errdefer header_view.deinit(allocator); │ │306 try box.children.put(allocator, header_view.getFocus().id, .{ .widget = .{ .repo_header = header_view }, .rect = null, .min_size = null });│ │307 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Commits.zig│ ╰───────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │15 │ │16 // how many commits a page shows before a "next" link appears. │ │17 const page_size = 20; │ │18 -// how many diff hunks one window of a commit's diff shows; "next"/"previous"│ │19 -// move to the adjacent window. │ │18 // the largest message read even when it has fewer than the preview's line │ │19 // limit. │ │20 const max_message_size = 100 * 1024; │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │38 // didn't name one), so the page can canonicalize its url to it. │ │39 ref_or_oid: ui.RoutablePage.RefOrOid, │ │40 ref_or_oid_value: []const u8, │ │41 +base_oid: []const u8 = "", │ │42 commit_count: ?u64 = null, │ │43 commits: []const Commit, │ │44 // the first oid of the next page, or null when this is the last page.│ ╰──────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────╮ │45 next_start: ?[]const u8, │ │46 // what the pane shows for the commit the log walks from. │ │47 content: Content = .{ .diff = .{} }, │ │49 -// the "viewing <ref> <value>" banner shown above the log.│ │48 +// the ref banner shown above the log. │ │49 header: Header, │ │50 │ │51 const Self = @This(); │ ╰──────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────╮ │79 requested_ref_or_oid: ?ui.RoutablePage.RefOrOid, │ │80 requested_value: []const u8, │ │81 content: ui.RoutablePage.RepoCommitsRoute.Content, │ │83 - base_oid_maybe: ?[xit.hash.hexLen(repo_opts.hash)]u8, │ │82 + base_oid: []const u8, │ │83 ) !Self { │ │84 const aa = arena.allocator(); │ │85 const hex_len = ui.ResolvedRefOrOid(repo_kind, repo_opts).hex_len;│ ╰──────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────╮ │86 + if (base_oid.len != 0) { │ │87 + evt.PatchRev.validateOid(repo_opts.hash, base_oid) catch return error.NotFound;│ │88 + } │ │89 │ │90 // the walk root's message replaces its diff, so it's read whole and its │ │91 // hunks aren't rendered. the window and the filter are its diff's. │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯