authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-24 12:13:46 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-24 12:13:46 -08:00
loge740ed3459ee9eab32ed2e2fabb4ee670dcd8094
tree488e03ec3c9eb419fbe67b49f5ebfffe3da2e8f6
parentb291df3aa42c279eb53dbdefb0f1026948d92368

tracer added a fmt param


1 files changed, 15 insertions(+), 15 deletions(-)

git.zig+15-15
......@@ -28,7 +28,7 @@ pub fn version(alloc: std.mem.Allocator) !string {
2828/// dir must already be pointing at the .git folder
2929// TODO this doesnt handle when there are 0 commits
3030pub fn getHEAD(alloc: std.mem.Allocator, dir: std.fs.Dir) !?CommitId {
31 const t = tracer.trace(@src());
31 const t = tracer.trace(@src(), "", .{});
3232 defer t.end();
3333
3434 const h = std.mem.trimRight(u8, try dir.readFileAlloc(alloc, "HEAD", 1024), "\n");
......@@ -74,7 +74,7 @@ fn ensureObjId(comptime T: type, input: string) T {
7474// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
7575// https://git-scm.com/book/en/v2/Git-Internals-Packfiles
7676pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string {
77 const t = tracer.trace(@src());
77 const t = tracer.trace(@src(), "", .{});
7878 defer t.end();
7979
8080 const result = try std.ChildProcess.exec(.{
......@@ -92,7 +92,7 @@ pub fn getObject(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !string {
9292// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
9393// https://git-scm.com/book/en/v2/Git-Internals-Packfiles
9494pub fn getObjectSize(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !u64 {
95 const t = tracer.trace(@src());
95 const t = tracer.trace(@src(), "", .{});
9696 defer t.end();
9797
9898 const result = try std.ChildProcess.exec(.{
......@@ -108,7 +108,7 @@ pub fn getObjectSize(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !u64 {
108108// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
109109// https://git-scm.com/book/en/v2/Git-Internals-Packfiles
110110pub fn isType(alloc: std.mem.Allocator, dir: std.fs.Dir, maybeobj: Id, typ: Tree.Object.Id.Tag) !?bool {
111 const t = tracer.trace(@src());
111 const t = tracer.trace(@src(), "", .{});
112112 defer t.end();
113113
114114 const result = try std.ChildProcess.exec(.{
......@@ -125,7 +125,7 @@ pub fn isType(alloc: std.mem.Allocator, dir: std.fs.Dir, maybeobj: Id, typ: Tree
125125// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
126126// https://git-scm.com/book/en/v2/Git-Internals-Packfiles
127127pub fn getType(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !Tree.Object.Id.Tag {
128 const t = tracer.trace(@src());
128 const t = tracer.trace(@src(), "", .{});
129129 defer t.end();
130130
131131 const result = try std.ChildProcess.exec(.{
......@@ -144,7 +144,7 @@ pub fn getType(alloc: std.mem.Allocator, dir: std.fs.Dir, obj: Id) !Tree.Object.
144144// https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
145145// https://git-scm.com/book/en/v2/Git-Internals-Packfiles
146146pub fn revList(alloc: std.mem.Allocator, dir: std.fs.Dir, comptime count: u31, from: CommitId, sub_path: string) !string {
147 const t = tracer.trace(@src());
147 const t = tracer.trace(@src(), "", .{});
148148 defer t.end();
149149
150150 const result = try std.ChildProcess.exec(.{
......@@ -164,7 +164,7 @@ pub fn revList(alloc: std.mem.Allocator, dir: std.fs.Dir, comptime count: u31, f
164164}
165165
166166pub fn parseCommit(alloc: std.mem.Allocator, commitfile: string) !Commit {
167 const t = tracer.trace(@src());
167 const t = tracer.trace(@src(), "", .{});
168168 defer t.end();
169169
170170 var iter = std.mem.split(u8, commitfile, "\n");
......@@ -188,7 +188,7 @@ pub fn parseCommit(alloc: std.mem.Allocator, commitfile: string) !Commit {
188188}
189189
190190fn parseCommitUserAndAt(input: string) !Commit.UserAndAt {
191 const t = tracer.trace(@src());
191 const t = tracer.trace(@src(), "", .{});
192192 defer t.end();
193193
194194 // Mitchell Hashimoto <mitchell.hashimoto@gmail.com> 1680797363 -0700
......@@ -243,7 +243,7 @@ pub const Commit = struct {
243243};
244244
245245pub fn parseTree(alloc: std.mem.Allocator, treefile: string) !Tree {
246 const t = tracer.trace(@src());
246 const t = tracer.trace(@src(), "", .{});
247247 defer t.end();
248248
249249 var iter = std.mem.split(u8, treefile, "\n");
......@@ -277,7 +277,7 @@ pub fn parseTree(alloc: std.mem.Allocator, treefile: string) !Tree {
277277}
278278
279279fn parseTreeMode(input: string) !Tree.Object.Mode {
280 const t = tracer.trace(@src());
280 const t = tracer.trace(@src(), "", .{});
281281 defer t.end();
282282
283283 std.debug.assert(input.len == 6);
......@@ -385,7 +385,7 @@ pub const Tree = struct {
385385// TODO make this inspect .git manually
386386// TODO make this return a Reader when we implement it ourselves
387387pub fn getTreeDiff(alloc: std.mem.Allocator, dir: std.fs.Dir, commitid: CommitId, parentid: ?CommitId) !string {
388 const t = tracer.trace(@src());
388 const t = tracer.trace(@src(), "", .{});
389389 defer t.end();
390390
391391 if (parentid == null) {
......@@ -411,7 +411,7 @@ pub fn getTreeDiff(alloc: std.mem.Allocator, dir: std.fs.Dir, commitid: CommitId
411411}
412412
413413pub fn parseTreeDiffMeta(input: string) !TreeDiffMeta {
414 const t = tracer.trace(@src());
414 const t = tracer.trace(@src(), "", .{});
415415 defer t.end();
416416
417417 var result = std.mem.zeroes(TreeDiffMeta);
......@@ -485,7 +485,7 @@ pub const TreeDiffMeta = struct {
485485};
486486
487487pub fn parseTreeDiff(alloc: std.mem.Allocator, input: string) !TreeDiff {
488 const t = tracer.trace(@src());
488 const t = tracer.trace(@src(), "", .{});
489489 defer t.end();
490490
491491 var lineiter = std.mem.split(u8, input, "\n");
......@@ -644,7 +644,7 @@ pub const TreeDiff = struct {
644644};
645645
646646pub fn getBranches(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {
647 const t = tracer.trace(@src());
647 const t = tracer.trace(@src(), "", .{});
648648 defer t.end();
649649
650650 const result = try std.ChildProcess.exec(.{
......@@ -670,7 +670,7 @@ pub fn getBranches(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {
670670}
671671
672672pub fn getTags(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const Ref {
673 const t = tracer.trace(@src());
673 const t = tracer.trace(@src(), "", .{});
674674 defer t.end();
675675
676676 // 97bc4b5f87656a34139e1a8122866c8c5b432598 refs/tags/1.2.5