authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-07-02 01:10:53 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-07-02 01:10:53 -07:00
logfb0cc022af2799fee172d9e8bfd37561ad68c6e6
tree543a180ca58641a54439b22e28405ff9ad865df0
parent8242af7c61028c1b840b5d680b963a395b5d1100
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

remove revList


1 files changed, 0 insertions(+), 20 deletions(-)

git.zig-20
...@@ -124,26 +124,6 @@ pub fn ensureObjId(comptime T: type, input: string) T {...@@ -124,26 +124,6 @@ pub fn ensureObjId(comptime T: type, input: string) T {
124 return .{ .id = input[0..40] };124 return .{ .id = input[0..40] };
125}125}
126126
127// TODO make this inspect .git/objects manually
128// TODO make a version of this that accepts an array of sub_paths and searches all of them at once, so as to not lose spot in history when searching for many old paths
129// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
130// https://git-scm.com/book/en/v2/Git-Internals-Packfiles
131pub fn revList(alloc: std.mem.Allocator, dir: nfs.Dir, comptime count: u31, from: CommitId, sub_path: string) !string {
132 const t = tracer.trace(@src(), "({d}) {s} -- {s}", .{ count, from.id, sub_path });
133 defer t.end();
134
135 const result = try root.child_process.run(alloc, dir, .ignore, .pipe, .pipe, 1024 * 1024 * 10, &.{
136 "git",
137 "rev-list",
138 "-" ++ std.fmt.comptimePrint("{d}", .{count}),
139 from.id,
140 "--",
141 sub_path,
142 });
143 std.debug.assert(result.term == .exited and result.term.exited == 0);
144 return std.mem.trimEnd(u8, result.stdout, "\n");
145}
146
147// TODO make this inspect .git/objects manually127// TODO make this inspect .git/objects manually
148// TODO make a version of this that accepts an array of sub_paths and searches all of them at once, so as to not lose spot in history when searching for many old paths128// TODO make a version of this that accepts an array of sub_paths and searches all of them at once, so as to not lose spot in history when searching for many old paths
149// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects129// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects