╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───╮ │src/push.zig│ ╰────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │363 } │ │364 │ │365 if (!refreshed) pch.refreshMergeability(repo_opts, io, allocator, target_repo, patch_id); │ │366 + find.refresh(repo_opts, io, allocator, fork_repo) catch |err| { │ │367 + serve_common.logError(io, error_writer, "failed to refresh file index: {s}\n", .{@errorName(err)});│ │368 + }; │ │369 progress.run(io, .{ .complete_one = .writing_patch }) catch {}; │ │370 progress.run(io, .{ .end = .writing_patch }) catch {}; │ │371 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/test/ui.zig│ ╰───────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │202 .{ .oid = oid0, .date = "2024-01-01", .message = "first", .window = .{} }, │ │203 }, │ │204 .next_start = next_oid, │ │205 - .header = try Commits.Header.init(arena.allocator(), .object, oid0), │ │205 }; │ │206 │ │207 var session = ui.Session{ .arena = &arena, .page_arena = &arena, .is_terminal = true };│ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭───────────────────────────╮ │12 const hash = xit.hash; │ │13 const obj = xit.object;│ │14 const ui = hx.ui; │ │15 +const find = hx.find; │ │16 const fork = hx.fork; │ │17 const pch = hx.pch; │ │18 │ ╰───────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │822 try evt.consume(.local, .repo, .xit, .{}, io, allocator, &template_repo, evt.events_ref, &discussion_comment_events);│ │823 try template_repo.patchAll(io, allocator, null); │ │824 try template_repo.addConfig(io, allocator, .{ .name = "core.bare", .value = "true" }); │ │825 + // fixtures commit directly, so index the branch tips by hand │ │826 + try find.refresh(.{}, io, allocator, &template_repo); │ │827 } │ │828 │ │829 // copy the template to each repo's on-disk location, named by its │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │1068 } │ │1069 try fork_repo.patchAll(io, allocator, null); │ │1070 try fork_repo.addConfig(io, allocator, .{ .name = "core.bare", .value = "true" });│ │1071 + // the commits above skipped the push path, so index the patch branch by hand │ │1072 + try find.refresh(.{}, io, allocator, &fork_repo); │ │1073 try fork_dir.deleteFile(io, path); │ │1074 const revision_id = evt.EventWithId.randomId(random); │ │1075 const head_tree_oid = try commitTree(io, allocator, &fork_repo, &source_oid); │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │193 │ │194 // the "key:value" segments of a url tail, collected in any order │ │195 const Params = struct { │ │196 - const ParamKey = enum { start, line, branch, tag, object, base, patchrev, theirs }; │ │196 + const ParamKey = enum { start, line, branch, tag, object, base, patchrev, theirs, find };│ │197 │ │198 // a branch:/tag:/object: param; the value stays url-encoded │ │199 const RefParam = struct { kind: RefOrOid, value: []const u8 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │271 const tag_filter_seg = @tagName(Params.ParamKey.tag) ++ ":";│ │272 const start_seg = @tagName(Params.ParamKey.start) ++ ":"; │ │273 const line_seg = @tagName(Params.ParamKey.line) ++ ":"; │ │274 + const find_seg = @tagName(Params.ParamKey.find) ++ ":"; │ │275 const base_seg = @tagName(Params.ParamKey.base) ++ ":"; │ │276 const theirs_seg = @tagName(Params.ParamKey.theirs) ++ ":"; │ │277 const issue_seg = "issue:"; │ ╰─────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │305 │ │306 // caps a url-encoded ref name in a route (a longer name doesn't route).│ │307 pub const ref_route_max_len = 512; │ │308 + │ │309 + // caps the files tab's url-encoded search term. │ │310 + pub const find_route_max_len = 100 * 3; │ │311 │ │312 // the identity stored by every repo route. Local routes elide it. │ │313 pub const RepoIdentity = struct { │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │341 ref_kind: ?RefOrOid = null, │ │342 ref_value: Array(ref_route_max_len) = .{}, │ │343 patchrev_id: Array(evt.event_id_size * 2) = .{}, │ │344 + // the url-encoded search term ("" = the plain directory listing). with│ │345 + // one set, `path` names the selected result rather than a directory. │ │346 + find: Array(find_route_max_len) = .{}, │ │347 path: Array(repo_route_max_len) = .{}, │ │348 // the selected file's first visible line (1-based; 0 = unset). │ │349 line: usize = 0, │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────╮ │395 pub const ForkFilesRoute = struct { │ │396 fork: ForkRoute, │ │397 oid: Array(ref_route_max_len) = .{}, │ │398 + find: Array(find_route_max_len) = .{},│ │399 path: Array(repo_route_max_len) = .{},│ │400 line: usize = 0, │ │401 }; │ ╰───────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯