GitHubivarvong

ply

main
ply6 git calls86 ms28 KiB4 cachedprotocol v2
334 lines18 KiBRaw
1// The streamed pack writer (src/packwrite.ts, #172): two deflate passes, never a held pack. Pure: no server.
2// pass 1 (measurePack) and pass 2 (streamPack) write the same bytes, and those are buildPack's (the buffered writer)
3// a pack pass 1 can keep (<= keep bytes) is held; a larger one is not
4// pass 2 refuses to finish a pack that is not pass 1's: longer, shorter, or the same length with other bytes. The
5// trailer is never written then, and never more than pass 1's length
6// deflatePull feeds DEFLATE_SLICE slices and stops when its reader stops
7import { test } from 'vitest';
8import assert from 'node:assert/strict';
9import { randomFillSync } from 'node:crypto';
10import { inflateSync } from 'node:zlib';
11import { measurePack, streamPack, deflatePull } from '../src/packwrite.js';
12import { buildPack, parsePack, resolvePack } from '../src/pack.js';
13import { TYPE } from '../src/objects.js';
14import { DEFLATE_SLICE, INFLATE_CHUNK, PACK_HEADER_BYTES, PACK_TRAILER_BYTES } from '../src/format.js';
15import { Sha1 } from '../src/sha1.js';
16import { unwrap } from './unwrap.js';
18const fill = (n, kind) => {
19 const d = new Uint8Array(n);
20 if (kind === 'random') randomFillSync(d);
21 if (kind === 'text') for (let i = 0; i < n; i++) d[i] = 97 + ((i * 7) % 13);
22 return d;
23};
24const readAll = async (stream) => {
25 const parts = []; const reader = stream.getReader();
26 for (;;) { const r = await reader.read(); if (r.done) break; parts.push(r.value); }
27 return Buffer.concat(parts);
28};
29// what a stream yields before it errors, and the error
30const readUntilError = async (stream) => {
31 const parts = []; const reader = stream.getReader();
32 try { for (;;) { const r = await reader.read(); if (r.done) return { bytes: Buffer.concat(parts), error: null }; parts.push(r.value); } }
33 catch (e) { return { bytes: Buffer.concat(parts), error: e }; }
34};
35const prefix = Uint8Array.of(1, 2, 3);
37test('both passes write buildPack\'s bytes, for every size around the chunk and every kind of content', async () => {
38 for (const n of [0, 1, 100, INFLATE_CHUNK - 1, INFLATE_CHUNK, INFLATE_CHUNK + 1, DEFLATE_SLICE - 1, DEFLATE_SLICE, DEFLATE_SLICE + 1, 3 * DEFLATE_SLICE + 7, 1 << 20]) {
39 for (const kind of ['random', 'zero', 'text']) {
40 const d = fill(n, kind);
41 const objects = [{ type: TYPE.BLOB, data: d }, { type: TYPE.BLOB, data: d.subarray(0, n >> 1) }, { type: TYPE.TREE, data: fill(40, 'text') }];
42 const built = await buildPack(objects);
43 const m = await measurePack(objects, 0);
44 assert.equal(m.held, null, `${n} ${kind}: keep 0 holds nothing`);
45 assert.equal(m.bytes, built.pack.length, `${n} ${kind}`);
46 assert.equal(m.body, built.pack.length - PACK_TRAILER_BYTES);
47 assert.deepEqual(m.entries, built.entries, `${n} ${kind}`);
48 assert.deepEqual(Buffer.from(m.digest), Buffer.from(built.pack.subarray(built.pack.length - PACK_TRAILER_BYTES)));
49 const s = streamPack(m, prefix);
50 assert.equal(s.length, prefix.length + built.pack.length);
51 const got = await readAll(s.stream);
52 assert.deepEqual(got, Buffer.concat([prefix, built.pack]), `${n} ${kind}`);
53 assert.equal(s.failure(), null);
54 }
55 }
56});
58test('pass 2 is the same bytes every time (CompressionStream is deterministic for the same slices)', async () => {
59 const objects = [{ type: TYPE.BLOB, data: fill(5 * INFLATE_CHUNK + 3, 'random') }, { type: TYPE.BLOB, data: fill(9 * INFLATE_CHUNK, 'text') }];
60 const m = await measurePack(objects, 0);
61 const a = await readAll(streamPack(m, prefix).stream);
62 const b = await readAll(streamPack(m, prefix).stream);
63 assert.deepEqual(a, b);
64 assert.equal(new Sha1().update(a.subarray(prefix.length, a.length - PACK_TRAILER_BYTES)).hex(), Buffer.from(m.digest).toString('hex'));
65});
67test('deltas: OFS and REF bases as buildPack writes them (one entry encoder, pack.ts entryHead), and the pack resolves', async () => {
68 const base = fill(3000, 'text');
69 const objects = [
70 { type: TYPE.BLOB, data: base },
71 { type: TYPE.BLOB, data: Uint8Array.of(0xb8, 0x17, 0xb8, 0x17, 0x91, 0, 0xb8, 0x17), base: { tag: 'ofs', index: 0 } }, // copy all 3000 bytes
72 { type: TYPE.BLOB, data: Uint8Array.of(1, 1, 1, 0x61), base: { tag: 'ref', oid: 'ab'.repeat(20) } },
73 { type: TYPE.BLOB, data: fill(10, 'text'), base: { tag: 'none' } },
74 { type: TYPE.BLOB, data: fill(10, 'zero'), base: undefined }, // left out: none
75 { type: TYPE.BLOB, data: Uint8Array.of(0xb8, 0x17, 0xb8, 0x17, 0x91, 0, 0xb8, 0x17), base: { tag: 'ofs', index: 1 } },
76 ];
77 const built = await buildPack(objects);
78 const m = await measurePack(objects, 0);
79 assert.deepEqual(m.entries, built.entries);
80 assert.deepEqual(m.entries.map(e => [e.type, e.typeName, e.baseOid]), [[TYPE.BLOB, 'blob', null], [TYPE.OFS_DELTA, 'ofs_delta', null], [TYPE.REF_DELTA, 'ref_delta', 'ab'.repeat(20)], [TYPE.BLOB, 'blob', null], [TYPE.BLOB, 'blob', null], [TYPE.OFS_DELTA, 'ofs_delta', null]]);
81 const got = await readAll(streamPack(m, new Uint8Array(0)).stream);
82 assert.deepEqual(got, Buffer.from(built.pack));
83 const parsed = unwrap(parsePack(new Uint8Array(got)));
84 assert.equal(parsed.objects.length, 6);
85 // each base as the reader reads it back: the OFS distance names the entry it was given, the REF id as given
86 assert.deepEqual(parsed.objects.map(o => o.base), [{ tag: 'none' }, { tag: 'ofs', offset: built.entries[0].offset }, { tag: 'ref', oid: 'ab'.repeat(20) }, { tag: 'none' }, { tag: 'none' }, { tag: 'ofs', offset: built.entries[1].offset }]);
87});
89test('an unknown type id is written as given, with no type name (buildPack\'s typeNameOf)', async () => {
90 const m = await measurePack([{ type: 5, data: fill(3, 'text') }], 0);
91 assert.deepEqual([m.entries[0].type, m.entries[0].typeName], [5, null]);
92});
94test('pass 1 holds the pack exactly when it fits in keep (default INFLATE_CHUNK)', async () => {
95 const small = [{ type: TYPE.BLOB, data: fill(100, 'text') }];
96 const m = await measurePack(small);
97 const built = await buildPack(small);
98 assert.deepEqual(Buffer.from(m.held), Buffer.from(built.pack));
99 // a keep of exactly the pack's length holds it; one less does not
100 assert.deepEqual(Buffer.from((await measurePack(small, built.pack.length)).held), Buffer.from(built.pack));
101 assert.equal((await measurePack(small, built.pack.length - 1)).held, null);
102 // an empty pack is 32 bytes and is held
103 const empty = await measurePack([]);
104 assert.equal(empty.bytes, PACK_HEADER_BYTES + PACK_TRAILER_BYTES);
105 assert.deepEqual(Buffer.from(empty.held), Buffer.from((await buildPack([])).pack));
106 // an incompressible object past the chunk is not held by default
107 const big = await measurePack([{ type: TYPE.BLOB, data: fill(INFLATE_CHUNK, 'random') }]);
108 assert.equal(big.held, null);
109 assert.ok(big.bytes > INFLATE_CHUNK);
110});
112test('pass 2 refuses a pack that is not pass 1\'s, before its trailer and never past pass 1\'s length', async () => {
113 // the caller's object changes between the passes: same length, other bytes (the SHA-1 differs)
114 const same = fill(3 * INFLATE_CHUNK, 'random');
115 const m1 = await measurePack([{ type: TYPE.BLOB, data: same }], 0);
116 same[7] ^= 1;
117 const s1 = streamPack(m1, prefix);
118 const r1 = await readUntilError(s1.stream);
119 assert.equal(r1.error?.code, 'internal');
120 assert.equal(r1.error, s1.failure());
121 assert.match(r1.error.message, /second deflate pass wrote another pack; it was not sent whole/);
122 assert.equal(r1.bytes.length, prefix.length + m1.body, 'every byte but the trailer');
123 assert.deepEqual([r1.error.what, r1.error.got, r1.error.max], ['push pack', m1.body, m1.body]);
124 assert.equal(Object.hasOwn(r1.error, 'cause'), false, 'a refusal of its own has no cause');
126 // compressible at pass 1, incompressible at pass 2: longer. Refused on the chunk that would pass pass 1's length
127 const grows = fill(8 * INFLATE_CHUNK, 'zero');
128 const m2 = await measurePack([{ type: TYPE.BLOB, data: grows }], 0);
129 randomFillSync(grows);
130 const s2 = streamPack(m2, prefix);
131 const r2 = await readUntilError(s2.stream);
132 assert.match(r2.error.message, /ran longer than the first/);
133 assert.ok(r2.bytes.length <= prefix.length + m2.body, `${r2.bytes.length} <= ${prefix.length + m2.body}`);
134 assert.ok(s2.failure().got > m2.body);
136 // the other way: shorter
137 const shrinks = fill(8 * INFLATE_CHUNK, 'random');
138 const m3 = await measurePack([{ type: TYPE.BLOB, data: shrinks }], 0);
139 shrinks.fill(0);
140 const r3 = await readUntilError(streamPack(m3, prefix).stream);
141 assert.match(r3.error.message, /ran shorter than the first/);
142 assert.ok(r3.bytes.length < prefix.length + m3.body);
144 // a pack whose objects did not change is not refused, and the failure stays null
145 const s4 = streamPack(m3, prefix);
146 assert.equal(s4.failure(), null);
147});
149test('pass 2 records a deflate that fails as its failure, with the cause', async () => {
150 const m = await measurePack([{ type: TYPE.BLOB, data: fill(10, 'text') }], 0);
151 // an object whose data is not bytes any more: CompressionStream refuses the chunk
152 const broken = { ...m, objects: [{ type: TYPE.BLOB, data: { length: 10, buffer: new ArrayBuffer(10), subarray: () => { throw new Error('not bytes'); } } }] };
153 const s = streamPack(broken, prefix);
154 const r = await readUntilError(s.stream);
155 assert.equal(r.error.code, 'internal');
156 assert.match(r.error.message, /second deflate pass failed/);
157 assert.ok(r.error.cause instanceof Error);
158 assert.equal(r.error, s.failure());
159 assert.deepEqual(r.bytes.subarray(0, prefix.length), Buffer.from(prefix));
160 assert.ok(r.bytes.length < prefix.length + m.bytes, 'no trailer');
161});
163test('the prefix comes first, alone, and the stream reads nothing ahead', async () => {
164 const objects = [{ type: TYPE.BLOB, data: fill(4 * INFLATE_CHUNK, 'random') }];
165 const m = await measurePack(objects, 0);
166 const s = streamPack(m, prefix);
167 const reader = s.stream.getReader();
168 const first = await reader.read();
169 assert.deepEqual(Buffer.from(first.value), Buffer.from(prefix));
170 const second = await reader.read();
171 assert.equal(second.value.length, PACK_HEADER_BYTES, 'then the pack header');
172 await reader.cancel();
173 assert.equal(s.failure(), null, 'a cancel is not a failure');
174});
176test('deflatePull: a zlib stream of the object, chunk by chunk; a reader that stops stops it', async () => {
177 for (const n of [0, 5, INFLATE_CHUNK * 3 + 1]) {
178 const d = fill(n, 'random');
179 const parts = [];
180 for await (const z of deflatePull(d)) parts.push(z);
181 assert.deepEqual(new Uint8Array(inflateSync(Buffer.concat(parts))), d, `${n}`);
182 }
183 const it = deflatePull(fill(64 * INFLATE_CHUNK, 'random'));
184 const one = await it.next();
185 assert.equal(one.done, false);
186 const done = await it.return();
187 assert.equal(done.done, true);
188 assert.equal((await it.next()).done, true);
189});
191test('a pack streamed through resolvePack is the objects given', async () => {
192 const objects = [{ type: TYPE.BLOB, data: fill(2 * INFLATE_CHUNK + 9, 'text') }, { type: TYPE.COMMIT, data: fill(200, 'text') }];
193 const got = await readAll(streamPack(await measurePack(objects, 0), new Uint8Array(0)).stream);
194 const resolved = unwrap(resolvePack(unwrap(parsePack(new Uint8Array(got)))));
195 assert.deepEqual([...resolved.objects.values()].map(o => Buffer.from(o.data)).sort(Buffer.compare), objects.map(o => Buffer.from(o.data)).sort(Buffer.compare));
196});
198// push over a transport double that reads the body as receive-pack would and answers git's report (no side-band):
199// which body it got, and what push decided.
200import { push } from '../src/push.js';
201import { pkt, FLUSH, pktInit, pktStep } from '../src/pktline.js';
202import { withLimits } from '../src/limits.js';
204const spanStub = { set() {}, event() {}, error() {} };
205const reportFor = ref => Buffer.concat([unwrap(pkt('unpack ok\n')), unwrap(pkt(`ok ${ref}\n`)), FLUSH]);
206const doubleTransport = (limits = {}) => {
207 const t = {
208 limits: withLimits(limits), tracer: { span: async (_n, _o, fn) => fn(spanStub) }, parent: null, got: [],
209 async *frames(_service, body) {
210 const streamed = !(body instanceof Uint8Array);
211 const read = streamed ? await readUntilError(body.stream) : { bytes: Buffer.from(body), error: null };
212 t.got.push({ streamed, length: body.length, read: read.bytes.length, error: read.error });
213 yield* unwrap(pktStep(pktInit(), reportFor('refs/heads/main'))).frames;
214 },
215 };
216 return t;
217};
218const oid = c => c.repeat(40);
220test('push: a pack past INFLATE_CHUNK goes to the transport as a stream of the declared length; a small one as bytes', async () => {
221 for (const [size, streamed] of [[100, false], [4 * INFLATE_CHUNK, true]]) {
222 const t = doubleTransport();
223 const r = await push(t, { ref: 'refs/heads/main', oldOid: oid('0'), newOid: oid('a'), objects: [{ type: TYPE.BLOB, data: fill(size, 'random') }], sideband: false });
224 assert.equal(r.ok, true, r.error?.message);
225 assert.equal(t.got.length, 1);
226 assert.equal(t.got[0].streamed, streamed, `${size}`);
227 assert.equal(t.got[0].read, t.got[0].length, `${size}: the declared length is what was read`);
228 assert.equal(t.got[0].error, null);
229 assert.ok(r.value.packBytes > 0 && t.got[0].length > r.value.packBytes);
230 }
231});
233test('push: a stream pass 2 refused is ambiguous (original internal) even when the server answers ok', async () => {
234 const data = fill(4 * INFLATE_CHUNK, 'random');
235 const t = doubleTransport();
236 const real = t.frames;
237 t.frames = async function* (service, body) { data[5] ^= 1; yield* real.call(t, service, body); };
238 const r = await push(t, { ref: 'refs/heads/main', oldOid: oid('0'), newOid: oid('a'), objects: [{ type: TYPE.BLOB, data }], sideband: false });
239 assert.equal(r.ok, false);
240 assert.deepEqual([r.error.code, r.error.original], ['ambiguous', 'internal']);
241 assert.match(r.error.message, /^push outcome unknown: push: the pack's second deflate pass wrote another pack/);
242 assert.equal(t.got[0].error.code, 'internal');
243});
245test('push: the cap is pass 1\'s measured pack, checked before the transport is asked', async () => {
246 const data = fill(4 * INFLATE_CHUNK, 'random');
247 const m = await measurePack([{ type: TYPE.BLOB, data }]);
248 for (const [max, ok] of [[m.bytes, true], [m.bytes - 1, false]]) {
249 const t = doubleTransport({ maxPackBytes: max });
250 const r = await push(t, { ref: 'refs/heads/main', oldOid: oid('0'), newOid: oid('a'), objects: [{ type: TYPE.BLOB, data }], sideband: false });
251 assert.equal(r.ok, ok, `${max}`);
252 assert.equal(t.got.length, ok ? 1 : 0);
253 if (!ok) assert.deepEqual([r.error.code, r.error.got, r.error.max], ['limit_exceeded', m.bytes, max]);
254 else assert.equal(r.value.packBytes, m.bytes);
255 }
256});
258// CompressionStream as a spy: what it was fed (each slice's length), and whether its output was cancelled. pipeThrough
259// takes any { writable, readable } pair, so the real stream does the work.
260const spyDeflate = async (body) => {
261 const Real = globalThis.CompressionStream;
262 const seen = { slices: [], cancelled: 0 };
263 globalThis.CompressionStream = class {
264 constructor(format) {
265 const real = new Real(format);
266 const w = real.writable.getWriter();
267 this.writable = new WritableStream({ write: c => { seen.slices.push(c.length); return w.write(c); }, close: () => w.close(), abort: e => w.abort(e) });
268 const r = real.readable.getReader();
269 this.readable = new ReadableStream({ pull: async c => { const x = await r.read(); if (x.done) c.close(); else c.enqueue(x.value); }, cancel: e => { seen.cancelled++; return r.cancel(e); } }, { highWaterMark: 0 });
270 }
271 };
272 try { await body(seen); } finally { globalThis.CompressionStream = Real; }
273};
274// a Uint8Array that counts the slices taken of it (the writer reads an object only through subarray)
275class Counted extends Uint8Array { constructor(n) { super(n); this.taken = 0; } subarray(a, b) { this.taken++; return new Uint8Array(this.buffer, this.byteOffset + a, (b ?? this.length) - a); } }
276const settle = () => new Promise(r => setTimeout(r, 20));
278test('deflatePull feeds CompressionStream slices of at most DEFLATE_SLICE, and stops it when its reader stops', async () => {
279 assert.equal(DEFLATE_SLICE, 65_536);
280 await spyDeflate(async seen => {
281 const parts = [];
282 for await (const z of deflatePull(fill(5 * DEFLATE_SLICE + 3, 'random'))) parts.push(z);
283 assert.deepEqual(seen.slices, [DEFLATE_SLICE, DEFLATE_SLICE, DEFLATE_SLICE, DEFLATE_SLICE, DEFLATE_SLICE, 3]);
284 assert.equal(seen.cancelled, 0);
285 const it = deflatePull(fill(64 * INFLATE_CHUNK, 'random'));
286 await it.next();
287 await it.return();
288 assert.equal(seen.cancelled, 1, 'the deflate is cancelled');
289 });
290});
292test('nothing is read ahead: an object is sliced only when its zlib bytes are asked for', async () => {
293 const data = new Counted(4 * INFLATE_CHUNK);
294 randomFillSync(data);
295 const it = deflatePull(data);
296 await settle();
297 assert.equal(data.taken, 0, 'not before the first read');
298 await it.next();
299 const after = data.taken;
300 await settle();
301 assert.equal(data.taken, after, 'not past what the read needed');
302 await it.return();
304 const m = await measurePack([{ type: TYPE.BLOB, data }], 0);
305 data.taken = 0;
306 const reader = streamPack(m, prefix).stream.getReader();
307 for (let i = 0; i < 3; i++) await reader.read(); // the prefix, the pack header, the object's header
308 await settle();
309 assert.equal(data.taken, 0, 'the stream pulled nothing past the object header');
310 await reader.read();
311 assert.ok(data.taken > 0);
312 await reader.cancel();
313});
315test('cancelling pass 2 stops its deflate', async () => {
316 await spyDeflate(async seen => {
317 const m = await measurePack([{ type: TYPE.BLOB, data: fill(16 * INFLATE_CHUNK, 'random') }], 0);
318 seen.cancelled = 0;
319 const s = streamPack(m, prefix);
320 const reader = s.stream.getReader();
321 for (let i = 0; i < 4; i++) await reader.read();
322 await reader.cancel();
323 assert.equal(seen.cancelled, 1);
324 assert.equal(s.failure(), null);
325 });
326});
328test('push: a delete-only push measures no pack and reports no entries', async () => {
329 const t = doubleTransport();
330 const r = await push(t, { ref: 'refs/heads/main', oldOid: oid('a'), newOid: oid('0'), objects: [], sideband: false });
331 assert.equal(r.ok, true, r.error?.message);
332 assert.deepEqual([r.value.packBytes, r.value.entries], [0, []]);
333 assert.equal(t.got[0].streamed, false);
334});
Diagnostics6 git calls · 86 ms
CallStatusSizeTime086 ms
discover200191 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=191
git.server.agent=git/github-9922ec520325-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=191
git.pkt.payload.max=36
ls-refs20012 KiB · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=11990
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=152
git.pkt.data=151
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=11990
git.pkt.payload.max=122
git.ls_refs.count=151
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 102004.2 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=4347
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=19912563f540228593df0c489082e5e2508e21e4
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=4347
git.pkt.payload.max=4247
git.sideband.band1.bytes=4247
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=4247
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=a6caf8e129bea82c9bae4cbc7c130c9205add400
git.pack.full=10
Open pack map
fetchtree:0200919 B · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=919
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=800d30ba8923860bfc460ca884b7f9ba22083588
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=919
git.pkt.payload.max=892
git.sideband.band1.bytes=892
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=892
git.pack.trailer=5323b9266eea5ded637285d1c5320699f12be76e
Open pack map
fetchtree:02005.6 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=78
git.response.bytes=5724
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=58fabb6768b3f737ee9cd8bac647bdc27405fb4d
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=5724
git.pkt.payload.max=5697
git.sideband.band1.bytes=5697
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=1
git.pack.bytes=5697
git.pack.trailer=be7e0453974a5fe832f9065a33bb7e3434c10e9b
Open pack map
fetch2005.2 KiB78 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=5321
git.response.cache=MISS
git.response.duration_ms=78
git.fetch.wants=9a167174af6f759a0cf6669b920c01fead96a8f7
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=5321
git.pkt.payload.max=5294
git.sideband.band1.bytes=5294
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://github.com/ivarvong/ply
Ref
refs/heads/main
Commit
19912563f540228593df0c489082e5e2508e21e4
cf-ray
a5e0f8348f22332c
Request
949c281c…
Protocol
v2 · sha1
Agent
git/github-9922ec520325-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format