diff --git a/git.zig b/git.zig index 401bd94456a9a7c8013581c05778acb1fa1f4363..64693a1c682db7104f4ec92190788e6eb1c734e0 100644 --- a/git.zig +++ b/git.zig @@ -992,7 +992,7 @@ pub const Repository = struct { while (try iter.next()) |entry| { if (entry.type != .REG) continue; if (!std.mem.endsWith(u8, entry.name, ".idx")) continue; - std.log.debug("packdir iterate: {s}", .{entry.name}); + // std.log.debug("packdir iterate: {s}", .{entry.name}); const idx_file = try packdir.openFile(entry.name, .{}); defer idx_file.close(); @@ -1017,7 +1017,7 @@ pub const Repository = struct { const object_id = &extras.to_hex(name_bytes[i * 20 ..][0..20].*); const pack_offset = std.mem.readInt(u32, offset_bytes[i * 4 ..][0..4], .big); if (std.mem.eql(u8, object_id, oid)) { - std.log.debug("found {s} in {s} at offset {d}", .{ oid, idx_path, pack_offset }); + // std.log.debug("found {s} in {s} at offset {d}", .{ oid, idx_path, pack_offset }); const pack_index = r.pack_content.getIndex(idx_path) orelse clk: { var pack_path: [128]u8 = @splat(0); @memcpy(pack_path[0..13], "objects/pack/"); @@ -1040,7 +1040,7 @@ pub const Repository = struct { } else return null; // parse .pack - std.log.debug("pack_index={d} pack_offset={d}", .{ pack_index, pack_offset }); + // std.log.debug("pack_index={d} pack_offset={d}", .{ pack_index, pack_offset }); return try r.getPackedObject(oid, pack_index, pack_offset); } @@ -1087,7 +1087,7 @@ pub const Repository = struct { return obj; }, .ofs_delta => { - std.log.debug("type={s} size={d}", .{ @tagName(ty), size }); + // std.log.debug("type={s} size={d}", .{ @tagName(ty), size }); var offset: usize = 0; while (true) { const c2: usize = packedobj_fbs.takeByte(); @@ -1097,7 +1097,7 @@ pub const Repository = struct { } const base_pack_offset = pack_offset - offset; const base_obj = try r.getPackedObject(null, pack_index, base_pack_offset); - std.log.debug("base: type={s} content=[{d}]", .{ @tagName(base_obj.type), base_obj.content.len }); + // std.log.debug("base: type={s} content=[{d}]", .{ @tagName(base_obj.type), base_obj.content.len }); const compressed_content = packedobj_fbs.rest()[0..size]; var bufr = nio.FixedBufferStream([]const u8).init(compressed_content); @@ -1107,7 +1107,7 @@ pub const Repository = struct { try list.ensureUnusedCapacity(r.gpa, size); try std.compress.flate.inflate.decompress(.zlib, bufr.anyReadable(), list.writer(r.gpa)); - std.log.debug("transformation data={d}", .{list.items}); + // std.log.debug("transformation data={d}", .{list.items}); var unpackedobj_fbs = nio.FixedBufferStream([]const u8).init(list.items); @@ -1121,7 +1121,7 @@ pub const Repository = struct { if (c2 & 0x80 == 0) break; base_size += 1; } - std.log.debug("base_size={d}", .{base_size}); + // std.log.debug("base_size={d}", .{base_size}); var obj_size: usize = 0; while (true) { @@ -1130,7 +1130,7 @@ pub const Repository = struct { if (c2 & 0x80 == 0) break; obj_size += 1; } - std.log.debug("obj_size={d}", .{obj_size}); + // std.log.debug("obj_size={d}", .{obj_size}); while (unpackedobj_fbs.pos < unpackedobj_fbs.buffer.len) { const c2 = unpackedobj_fbs.takeByte(); @@ -1143,14 +1143,14 @@ pub const Repository = struct { } const start: u32 = @bitCast(b.items[0..4].*); const nbytes: u24 = @bitCast(b.items[4..7].*); - std.log.debug("- copy from base: start={d} nbytes={d}", .{ start, nbytes }); + // std.log.debug("- copy from base: start={d} nbytes={d}", .{ start, nbytes }); const bytes = base_obj.content[start..][0..nbytes]; // std.log.debug("{s}\n", .{bytes}); try list2.appendSlice(r.gpa, bytes); } else { // append new data const nbytes = c2 & 0x7f; - std.log.debug("- append new bytes={d}", .{nbytes}); + // std.log.debug("- append new bytes={d}", .{nbytes}); if (nbytes == 0) continue; const bytes = unpackedobj_fbs.takeSlice(nbytes); // std.log.debug("{s}\n", .{bytes}); @@ -1158,7 +1158,7 @@ pub const Repository = struct { } } - std.log.debug("- done", .{}); + // std.log.debug("- done", .{}); // std.log.debug("{s}\n", .{list2.items}); const _type = base_obj.type; const content = try list2.toOwnedSlice(r.gpa);