GitHubivarvong

ply

main
ply6 git calls102 ms29 KiB4 cachedprotocol v2
250 lines18 KiBRaw
1// Pure property tests: chunking invariance of every step function, codec roundtrips, oracle vs node:zlib/crypto.
2import { test } from 'vitest';
3import assert from 'node:assert/strict';
4import zlib from 'node:zlib';
5import crypto from 'node:crypto';
6import { Rng, splitRandom } from './fuzz/prng.js';
7import { genBlob, genFind, genReplace, KNOBS, countOccurrences } from './fuzz/gen.js';
8import { pkt, pkts, FLUSH, DELIM, pktInit, pktStep, pktFinish } from '../src/pktline.js';
9import { inflate } from '../src/inflate.js';
10import { Sha1, toHex } from '../src/sha1.js';
11import { encodeObjHeader, applyDelta, spliceDelta, makeDelta, parsePack, resolvePack, buildPack } from '../src/pack.js';
12import { parseTree, encodeTree, treeSort, hashObject, parseCommit, encodeCommit } from '../src/objects.js';
13import { spInit, spStep as spStepR, spFinish as spFinishR, scanInit, scanStep, scanFinish, MATCH_OFFSETS_KEPT } from '../src/edit.js';
14import { v2Init, v2Step as v2StepR } from '../src/client.js';
15import { concat, indexOfBytes } from '../src/bytes.js';
16import { assertBytes } from './bytes-assert.js';
17import { unwrap, unwrapAsync } from './unwrap.js';
19// Throwing adapters over the Result API (0.2.0): the assertions below are about the throw.
20const spStep = (...a) => unwrap(spStepR(...a));
21const spFinish = (...a) => unwrap(spFinishR(...a));
22const v2Step = (...a) => unwrap(v2StepR(...a));
23const N = parseInt(process.env.PROP_N ?? '200', 10);
24const SEED = parseInt(process.env.SEED ?? '1', 10);
25const forAll = (name, fn, n = N) => test(name, async () => { for (let i = 0; i < n; i++) { const rng = new Rng(SEED * 1000003 + i); try { await fn(rng, i); } catch (e) { e.message = `[case ${i} seed ${SEED}] ${e.message}`; throw e; } } });
27forAll('sha1: chunked == node crypto', rng => {
28 const d = rng.bytes(rng.int(0, 3000));
29 const h = new Sha1(); for (const c of splitRandom(rng, d)) h.update(c);
30 assert.equal(h.hex(), crypto.createHash('sha1').update(d).digest('hex'));
31});
33forAll('inflate: consumed exact, content equal, any level, trailing junk ignored', rng => {
34 const cls = rng.pick(['tiny', 'text', 'random', 'repetitive', 'boundary', 'empty', 'binaryish']);
35 const d = Buffer.from(genBlob(rng, cls));
36 const level = rng.int(-1, 9);
37 const z = zlib.deflateSync(d, { level, strategy: rng.pick([0, 0, 1, 2, 3, 4]) });
38 const pre = rng.bytes(rng.int(0, 5)), junk = rng.bytes(rng.int(0, 40));
39 const buf = concat([pre, z, junk]);
40 const r = unwrap(inflate(buf, pre.length, rng.bool() ? { expectedSize: d.length } : {}));
41 assert.equal(r.consumed, z.length);
42 assert.ok(Buffer.from(r.out).equals(d));
43 if (level === 0 && d.length) assert.ok(r.stats.stored > 0);
44 // truncation must throw, never hang
45 if (z.length > 3) assert.throws(() => unwrap(inflate(buf.subarray(0, pre.length + z.length - rng.int(1, 3)), pre.length)));
46});
48forAll('inflate: raw deflate', rng => {
49 const d = rng.bytes(rng.int(0, 2000));
50 const z = zlib.deflateRawSync(d);
51 const r = unwrap(inflate(concat([z, rng.bytes(3)]), 0, { raw: true }));
52 assert.equal(r.consumed, z.length); assertBytes(r.out, d);
53});
55forAll('pkt-line: decode is chunking-invariant and inverts encode', rng => {
56 const frames = Array.from({ length: rng.int(0, 30) }, () => rng.weighted([[{ kind: 'data', payload: rng.bytes(rng.pick([0, 1, 5, 100, 65516, rng.int(0, 65516)])) }, 6], [{ kind: 'flush' }, 2], [{ kind: 'delim' }, 1], [{ kind: 'end' }, 1]]));
57 const enc = concat(frames.map(f => f.kind === 'data' ? unwrap(pkt(f.payload)) : f.kind === 'flush' ? FLUSH : f.kind === 'delim' ? DELIM : new TextEncoder().encode('0002')));
58 let st = pktInit(); const got = [];
59 for (const c of splitRandom(rng, enc)) { const r = unwrap(pktStep(st, c)); st = r.state; got.push(...r.frames); assert.ok(!st.carry || st.carry.length < 65520); }
60 unwrap(pktFinish(st));
61 assert.equal(got.length, frames.length);
62 got.forEach((g, i) => { assert.equal(g.kind, frames[i].kind); if (g.kind === 'data') assertBytes(g.payload, frames[i].payload, `frame ${i} payload`); });
63 assert.equal(st.bytes, enc.length);
64});
66// #85: a failed comparison of two maximum pkt-line payloads must cost a short message, not a diff of 65,516 elements
67// (node:assert's diff of that pair went past 23 GB when a mutant zeroed the payload).
68test('pkt-line: a wrong maximum-size payload fails in bounded time and message', () => {
69 const want = Uint8Array.from({ length: 65516 }, (_, i) => (i * 7 + 1) & 0xff);
70 const got = new Uint8Array(want.length);
71 const t = Date.now();
72 assert.throws(() => assertBytes(got, want, 'payload'), e => e.message.length < 200 && /first difference at byte 0 of 65516/.test(e.message));
73 assert.throws(() => assertBytes(got.subarray(1), want, 'payload'), /65515 bytes, want 65516/);
74 assert.ok(Date.now() - t < 1000);
75});
77test('pkt-line: garbage throws', () => { assert.throws(() => unwrap(pktStep(pktInit(), new TextEncoder().encode('zzzz')))); assert.throws(() => unwrap(pktStep(pktInit(), new TextEncoder().encode('0003')))); });
79forAll('objHeader: encode/parse roundtrip incl. huge sizes', rng => {
80 const type = rng.int(1, 7), size = rng.pick([0, 1, 15, 16, 127, 128, 2 ** 20, 2 ** 31 + 5, 2 ** 40 + 3, rng.int(0, 1e9)]);
81 const h = encodeObjHeader(type, size);
82 let p = 0, c = h[p++], t = (c >> 4) & 7, s = c & 15, shift = 4;
83 while (c & 0x80) { c = h[p++]; s += (c & 0x7f) * 2 ** shift; shift += 7; }
84 assert.equal(t, type); assert.equal(s, size); assert.equal(p, h.length);
85});
87forAll('delta: spliceDelta/makeDelta ∘ applyDelta == reference splice', rng => {
88 const base = genBlob(rng, rng.pick(['empty', 'tiny', 'text', 'random', 'repetitive', 'boundary']));
89 const off = rng.int(0, base.length), oldLen = rng.int(0, base.length - off);
90 const insert = rng.bytes(rng.pick([0, 1, 127, 128, 255, rng.int(0, 3000)]));
91 const ref = concat([base.subarray(0, off), insert, base.subarray(off + oldLen)]);
92 const d1 = spliceDelta({ baseLen: base.length, off, oldLen, insert });
93 assert.equal(d1.resultLen, ref.length);
94 // git's patch_delta rejects deltas < 4 bytes (DELTA_SIZE_MIN); applyDelta mirrors that so a pack we would reject, git rejects too
95 if (d1.delta.length < 4) { assert.throws(() => unwrap(applyDelta(base, d1.delta)), /DELTA_SIZE_MIN/); assert.equal(ref.length, 0); return; }
96 assertBytes(unwrap(applyDelta(base, d1.delta)).out, ref);
97 const d2 = makeDelta(base, ref);
98 assertBytes(unwrap(applyDelta(base, d2.delta)).out, ref);
99 assert.ok(d2.delta.length <= insert.length + 2 * Math.ceil(base.length / 65536) * 8 + 20 + Math.ceil(insert.length / 127));
100});
102test('delta: 64K copy boundary and 0x10000 encoding', () => {
103 const base = new Uint8Array(0x20001).map((_, i) => i & 0xff);
104 const d = spliceDelta({ baseLen: base.length, off: 0x10000, oldLen: 0, insert: Uint8Array.of(9) });
105 const r = unwrap(applyDelta(base, d.delta));
106 assert.equal(r.out.length, base.length + 1); assert.equal(r.out[0x10000], 9); assert.equal(r.ops.copy, 3);
107});
109forAll('scan: chunking-invariant, equals replace-all, offsets exact, carry bounded', rng => {
110 const find = genFind(rng, rng.pick(KNOBS.find)), replace = genReplace(rng, rng.pick(KNOBS.replace), find);
111 // build data with k occurrences at random spots (possibly adjacent/overlapping-adjacent)
112 const k = rng.int(0, 4);
113 let data = genBlob(rng, rng.pick(['empty', 'tiny', 'text', 'random', 'boundary']));
114 if (countOccurrences(data, find)) data = rng.bytes(10);
115 for (let i = 0; i < k; i++) { const o = rng.int(0, data.length); data = concat([data.subarray(0, o), find, data.subarray(o)]); }
116 // reference
117 const refOffs = []; const refParts = []; let p = 0, i;
118 while ((i = indexOfBytes(data, find, p)) >= 0) { refOffs.push(i); refParts.push(data.subarray(p, i), replace); p = i + find.length; }
119 refParts.push(data.subarray(p));
120 const ref = concat(refParts);
121 let st = scanInit({ find, replace }); const out = [];
122 for (const c of splitRandom(rng, data, { maxChunks: 64 })) { const r = scanStep(st, c); st = r.state; out.push(...r.emit); assert.ok(st.carry.length <= find.length - 1); }
123 const f = scanFinish(st); st = f.state; out.push(...f.emit);
124 const got = concat(out);
125 assertBytes(got, ref);
126 assert.deepEqual(st.matches, refOffs.slice(0, MATCH_OFFSETS_KEPT));
127 assert.equal(st.count, refOffs.length);
128 assert.equal(st.emitted, ref.length);
129});
131forAll('single-object pack stream: chunking-invariant, trailer verified, zlib bytes exact', async rng => {
132 const data = genBlob(rng, rng.pick(['empty', 'tiny', 'text', 'random', 'boundary']));
133 const { pack } = await buildPack([{ type: 3, data }]);
134 let st = spInit(); const z = [];
135 for (const c of splitRandom(rng, pack, { maxChunks: 40 })) { const r = spStep(st, c); st = r.state; z.push(...r.zlib); assert.ok(st.lag.length <= 20); }
136 st = spFinish(st);
137 const hdrLen = 12 + encodeObjHeader(3, data.length).length;
138 assertBytes(concat(z), pack.subarray(hdrLen, pack.length - 20));
139 assert.equal(st.size, data.length); assert.equal(st.type, 3); assert.equal(st.trailer, toHex(pack.subarray(-20)));
140 // corrupt one byte → must throw
141 const bad = pack.slice(); bad[rng.int(0, bad.length - 1)] ^= 0x01;
142 assert.throws(() => { let s = spInit(); const r = spStep(s, bad); s = r.state; spFinish(s); });
143}, Math.min(60, N));
145// The zlib-length bound in spStep (zlibBound(size), format.js) is a pure function of the bytes seen: the same stream, split
146// into 1-byte chunks, 64 KiB chunks or at random, either finishes with the same state or throws the same error (code and
147// message carry no chunk-dependent count). The stream is k non-final empty stored blocks (5 bytes in, 0 bytes out) before a
148// real stored block: at the bound it inflates (node:zlib agrees on the bytes), one block past it is refused.
149forAll('single-object pack stream: the zlib-length bound is chunking-invariant and exact (I10)', rng => {
150 const data = rng.bytes(rng.int(0, 600));
151 const bound = data.length + Math.ceil(data.length / 8) + Math.ceil(data.length / 64) + 13;
152 const storedBlock = (d, final) => concat([Uint8Array.of(final ? 1 : 0, d.length & 0xff, d.length >> 8, ~d.length & 0xff, (~d.length >> 8) & 0xff), d]);
153 const adler = (() => { let a = 1, b = 0; for (const x of data) { a = (a + x) % 65521; b = (b + a) % 65521; } return Uint8Array.of(b >>> 8, b & 0xff, a >>> 8, a & 0xff); })();
154 const fixed = 2 + 5 + data.length + 4; // header, the final stored block, Adler-32
155 const room = Math.floor((bound - fixed) / 5); // empty stored blocks that still fit under the bound (0 for an empty blob)
156 const streamOf = k => concat([Uint8Array.of(0x78, 0x01), ...Array.from({ length: k }, () => storedBlock(new Uint8Array(0), false)), storedBlock(data, true), adler]);
157 const packOf = z => { const body = concat([Uint8Array.of(0x50, 0x41, 0x43, 0x4b, 0, 0, 0, 2, 0, 0, 0, 1), encodeObjHeader(3, data.length), z]); return concat([body, new Sha1().update(body).digest()]); };
158 const run = (pack, chunks) => {
159 let st = spInit(); const z = [];
160 try { for (const c of chunks) { const r = spStep(st, c); st = r.state; z.push(...r.zlib); } st = spFinish(st); }
161 catch (e) { return { threw: `${e.code}: ${e.message}` }; }
162 return { threw: null, zlib: concat(z), size: st.size, zlibBytes: st.zlibBytes };
163 };
164 // whole (what a 64 KiB chunk delivers for a pack this size), 1-byte, random, and two halves
165 const splits = pack => [[pack], Array.from(pack, b => Uint8Array.of(b)), [...splitRandom(rng, pack, { maxChunks: 40 })], [pack.subarray(0, pack.length >> 1), pack.subarray(pack.length >> 1)]];
166 const under = packOf(streamOf(room)), over = packOf(streamOf(room + 1));
167 assert.ok(under.length - 32 - encodeObjHeader(3, data.length).length <= bound && over.length - 32 - encodeObjHeader(3, data.length).length > bound);
168 const okRuns = splits(under).map(c => run(under, c));
169 for (const r of okRuns) { assert.equal(r.threw, null); assert.equal(r.size, data.length); assert.ok(r.zlibBytes <= bound); assertBytes(zlib.inflateSync(r.zlib), data); assertBytes(unwrap(inflate(r.zlib, 0, { expectedSize: data.length })).out, data); }
170 const badRuns = splits(over).map(c => run(over, c));
171 for (const r of badRuns) assert.equal(r.threw, `pack_corrupt: pack: zlib stream longer than its declared size allows (${data.length}-byte object, ${bound}-byte bound)`);
172 // the buffered inflate agrees with the streamed parser on both sides of the bound
173 assert.equal(unwrap(inflate(streamOf(room), 0, { expectedSize: data.length })).consumed, under.length - 32 - encodeObjHeader(3, data.length).length);
174 assert.throws(() => unwrap(inflate(streamOf(room + 1), 0, { expectedSize: data.length })), e => e.code === 'pack_corrupt' && /zlib stream longer than its declared size allows/.test(e.message));
175}, Math.min(60, N));
177forAll('pack: buildPack ∘ parsePack ∘ resolvePack is identity (full + ref-delta + thin)', async rng => {
178 const base = genBlob(rng, rng.pick(['tiny', 'text', 'random']));
179 const target = concat([base.subarray(0, base.length >> 1), rng.bytes(rng.int(0, 200)), base.subarray(base.length >> 1)]);
180 const baseOid = hashObject('blob', base);
181 const inPack = rng.bool();
182 const objs = [...(inPack ? [{ type: 3, data: base }] : []), { type: 3, data: makeDelta(base, target).delta, base: { tag: 'ref', oid: baseOid } }, { type: 2, data: unwrap(encodeTree([{ mode: '100644', name: 'f', oid: baseOid }])) }];
183 const { pack } = await buildPack(objs);
184 const parsed = unwrap(parsePack(pack));
185 assert.equal(parsed.stats.count, objs.length); assert.equal(parsed.stats.refDelta, 1);
186 const r = unwrap(resolvePack(parsed, oid => (oid === baseOid && !inPack ? { type: 3, data: base } : undefined)));
187 const t = r.objects.get(hashObject('blob', target));
188 assert.ok(t); assertBytes(t.data, target); assert.equal(t.chain, 1);
189 assert.equal(r.stats.externalBases, inPack ? 0 : 1);
190 // trailer corruption
191 const bad = pack.slice(); bad[bad.length - 1] ^= 1; assert.throws(() => unwrap(parsePack(bad)));
192}, Math.min(60, N));
194forAll('tree: parse ∘ encode roundtrip and sort is total order with dir-as-slash rule', rng => {
195 const names = ['a', 'a-b', 'a.b', 'a0', 'a_b', 'ab', 'A', 'a~', 'z', 'é', 'a b', 'a--', '-a', '.h', 'ä', '한', '🚀', 'b', 'a.', 'a/'.slice(0, 1)];
196 const entries = []; const seen = new Set();
197 for (let i = rng.int(1, 12); i > 0; i--) {
198 const name = rng.pick(names); const mode = rng.pick(['100644', '100755', '40000', '120000', '160000']);
199 const key = (mode === '40000' ? name + '/' : name); if (seen.has(key) || seen.has(name) || seen.has(name + '/')) continue; seen.add(key);
200 entries.push({ mode, name, oid: toHex(rng.bytes(20)) });
201 }
202 const enc = unwrap(encodeTree(entries));
203 const parsed = unwrap(parseTree(enc));
204 assert.deepEqual(parsed.map(e => [e.mode, e.name, e.oid]), unwrap(treeSort(entries)).map(e => [e.mode, e.name, e.oid]));
205 assertBytes(unwrap(encodeTree(parsed)), enc);
206 parsed.forEach(e => assert.equal(toHex(enc.subarray(e.oidOffset, e.oidOffset + 20)), e.oid));
207});
209test('tree: rejects truncated OIDs, including a missing final byte', () => {
210 assert.deepEqual(unwrap(parseTree(new Uint8Array(0))), []);
211 const entries = ['a', 'b'].map(name => ({ mode: '100644', name, oid: 'ab'.repeat(20) }));
212 for (const count of [1, 2]) {
213 const data = unwrap(encodeTree(entries.slice(0, count)));
214 assert.deepEqual(unwrap(parseTree(data)).map(({ mode, name, oid }) => ({ mode, name, oid })), entries.slice(0, count));
215 for (let missing = 1; missing <= 20; missing++) {
216 assert.throws(() => unwrap(parseTree(data.subarray(0, data.length - missing))), { code: 'pack_corrupt' }, `${count} entries, missing ${missing} OID bytes`);
217 }
218 }
219});
221forAll('commit: parse ∘ encode', rng => {
222 const c = { tree: toHex(rng.bytes(20)), parents: Array.from({ length: rng.int(0, 3) }, () => toHex(rng.bytes(20))), author: 'A <a@x> 1700000000 +0000', committer: 'B <b@x> 1700000001 -0500', message: rng.pick(['m', 'multi\nline\n', 'no newline', '']) };
223 const p = unwrap(parseCommit(unwrap(encodeCommit(c))));
224 assert.equal(p.tree, c.tree); assert.deepEqual(p.parents, c.parents); assert.equal(p.author, c.author); assert.equal(p.committer, c.committer);
225 assert.equal(p.message.replace(/\n$/, ''), c.message.replace(/\n$/, ''));
226});
228test('v2 fetch state machine: sections → sideband → flush; band 3 throws; ERR throws', () => {
229 const te = new TextEncoder();
230 let st = v2Init(); const chunks = [];
231 const feed = f => { const r = v2Step(st, f); st = r.state; if (r.pack) chunks.push(r.pack); };
232 feed({ kind: 'data', payload: te.encode('shallow-info\n') }); feed({ kind: 'data', payload: te.encode('shallow abc\n') }); feed({ kind: 'delim' });
233 feed({ kind: 'data', payload: te.encode('packfile\n') });
234 feed({ kind: 'data', payload: concat([Uint8Array.of(1), te.encode('PACK')]) }); feed({ kind: 'data', payload: concat([Uint8Array.of(2), te.encode('progress')]) });
235 feed({ kind: 'flush' });
236 assert.deepEqual(st.shallow, ['abc']); assert.deepEqual(st.sections, ['shallow-info', 'packfile']); assert.equal(st.band1, 4); assert.equal(st.band2, 8); assert.ok(st.done);
237 assert.equal(new TextDecoder().decode(concat(chunks)), 'PACK');
238 assert.throws(() => v2Step(st, { kind: 'data', payload: te.encode('x') }));
239 assert.throws(() => v2Step({ ...v2Init(), phase: 'pack' }, { kind: 'data', payload: concat([Uint8Array.of(3), te.encode('boom')]) }), /remote: boom/);
240 assert.throws(() => v2Step(v2Init(), { kind: 'data', payload: te.encode('ERR nope\n') }), /remote: nope/);
241});
243test('ls-refs: sha256 object ids are rejected as unsupported before any fetch', async () => {
244 const te2 = new TextEncoder();
245 const body = concat([unwrap(pkt(te2.encode(`${'ab'.repeat(32)} refs/heads/main\n`))), FLUSH]);
246 const { GitHttp } = await import('../src/client.js');
247 const { Tracer } = await import('../src/otel.js');
248 const c = unwrap(GitHttp.create('http://x.invalid/r.git', { tracer: new Tracer(), fetchImpl: async () => new Response(body, { status: 200, headers: { 'content-type': 'application/x-git-upload-pack-result' } }) }));
249 await assert.rejects(unwrapAsync(c.lsRefs(['refs/heads/main'])), e => e.code === 'unsupported');
250});
Diagnostics6 git calls · 102 ms
CallStatusSizeTime0102 ms
discover200191 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
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 KiB70 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=70
git.response.bytes=11990
git.response.cache=EXPIRED
git.response.duration_ms=70
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 · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=919
git.response.cache=HIT
git.response.duration_ms=3
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 · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=5724
git.response.cache=HIT
git.response.duration_ms=3
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
fetch2006.1 KiB · hit24 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=24
git.response.bytes=6229
git.response.cache=HIT
git.response.duration_ms=24
git.fetch.wants=80d561d7b1a8f4b93064dda90b64b4ea31806ea0
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=6229
git.pkt.payload.max=6202
git.sideband.band1.bytes=6202
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
a5e19f600ed33cd0
Request
fcefdb7c…
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