╭ changed ────╮ │build.zig.zon│ ╰─────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 3 .version = "0.0.0", │ │ 4 .dependencies = .{ │ │ 5 .xit = .{ │ │ 6 - .url = "git+https://github.com/xit-vcs/xit#633342d83c27793e11ba3cad06022620c27d1d2a",│ │ 7 - .hash = "xit-0.0.0-Ub3nDMKNUwERebcYq6bdcJsT78hm-SB3JmK322BrBjjw", │ │ 6 + .url = "git+https://github.com/xit-vcs/xit#dba9c884daa5d5819ee82592aafa10043508531c",│ │ 7 + .hash = "xit-0.0.0-Ub3nDAGQUwGbntCLOsOx-h4tZw7UElsOWw1J9X_eHIY_", │ │ 8 }, │ │ 9 }, │ │10 .paths = .{ │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───╮ │src/fork.zig│ ╰────────────╯ ╭────────────────────────────────────────────╮ │1 const std = @import("std"); │ │2 const evt = @import("event.zig"); │ │3 const find = @import("find.zig"); │ │4 +const cms = @import("search_commit.zig");│ │5 const xit = @import("xit"); │ │6 const rp = xit.repo; │ │7 const hash = xit.hash; │ ╰────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │139 │ │140 _ = try moment.remove(hash.hashInt(repo_opts.hash, evt.history_key)); │ │141 _ = try moment.remove(hash.hashInt(repo_opts.hash, evt.last_object_id_key)); │ │142 + // forks aren't searched, so the copied versions would linger │ │143 + // with nothing to prune them │ │144 + _ = try moment.remove(hash.hashInt(repo_opts.hash, cms.index_key)); │ │145 │ │146 if (head_oid_maybe) |*head_oid| { │ │147 try rf.write(.xit, repo_opts, state, ctx.io, patch_path, .{ .oid = head_oid });│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/lib.zig│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────╮ │ 4 pub const event = @import("./event.zig"); │ │ 5 pub const push = @import("./push.zig"); │ │ 6 pub const find = @import("./find.zig"); │ │ 7 +pub const search = @import("./search.zig"); │ │ 8 +pub const search_commit = @import("./search_commit.zig");│ │ 9 pub const fork = @import("./fork.zig"); │ │10 pub const pch = @import("./patch.zig"); │ │11 pub const serve = @import("./serve.zig"); │ ╰─────────────────────────────────────────────────────────────╯ ╭ changed ────╮ │src/patch.zig│ ╰─────────────╯ ╭─────────────────────────────────────────────────────╮ │ 7 const rf = xit.ref; │ │ 8 const mrg = xit.merge; │ │ 9 const find = @import("find.zig"); │ │10 +const cms = @import("search_commit.zig"); │ │11 const fork = @import("fork.zig"); │ │12 const serve_common = @import("serve_common.zig");│ │13 │ ╰─────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │753 }); │ │754 } │ │755 refreshMergeability(repo_opts, io, allocator, target_repo, null); │ │755 - // the merge moved the target branch, so its file index follows │ │756 + // the merge moved the target branch, so its indexes follow │ │757 find.refresh(repo_opts, io, allocator, target_repo) catch |err| { │ │758 std.log.warn("failed to refresh file index: {s}", .{@errorName(err)});│ │759 }; │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │760 + cms.refresh(repo_opts, io, allocator, target_repo, null) catch |err| { │ │761 + std.log.warn("failed to refresh commit index: {s}", .{@errorName(err)});│ │762 + }; │ │763 } │ │764 │ │765 // merge a published patch and remove its fork │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───╮ │src/push.zig│ ╰────────────╯ ╭─────────────────────────────────────────────────────╮ │ 8 const evt = @import("event.zig"); │ │ 9 const pch = @import("patch.zig"); │ │10 const find = @import("find.zig"); │ │11 +const cms = @import("search_commit.zig"); │ │12 const fork = @import("fork.zig"); │ │13 const serve_common = @import("serve_common.zig");│ │14 │ ╰─────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │159 }; │ │160 find.refresh(repo_opts, io, allocator, repo) catch |err| { │ │161 serve_common.logError(io, error_writer, "failed to refresh file index: {s}\n", .{@errorName(err)}); │ │162 + }; │ │163 + cms.refresh(repo_opts, io, allocator, repo, updates.items.items) catch |err| { │ │164 + serve_common.logError(io, error_writer, "failed to refresh commit index: {s}\n", .{@errorName(err)});│ │165 }; │ │166 try response.finish(writer, null); │ │167 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/test/ui.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │282 previous = tip; │ │283 tip = try repo.commitAtRef(io, allocator, .{ .message = "next" }, null, branch); │ │284 } │ │285 - const first = try Commits.init(kind, opts, &arena, &repo, io, allocator, null, location, .object, &tip, content, &base); │ │285 + const first = try Commits.init(kind, opts, &arena, &repo, io, allocator, null, location, .object, &tip, content, &base, "", ""); │ │286 try std.testing.expectEqual(20, first.commits.len); │ │287 try std.testing.expectEqual(@as(?u64, if (kind == .xit) 21 else null), first.commit_count); │ │288 - const last = try Commits.init(kind, opts, &arena, &repo, io, allocator, null, location, .object, first.next_start orelse return error.MissingNext, content, &base); │ │288 + const last = try Commits.init(kind, opts, &arena, &repo, io, allocator, null, location, .object, first.next_start orelse return error.MissingNext, content, &base, "", "");│ │289 try std.testing.expectEqual(1, last.commits.len); │ │290 try std.testing.expectEqual(null, last.next_start); │ │291 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯