GitHubivarvong
ply
main
1// #209: the ls-refs listing reader without a state copy per ref, and the line parser reading by index. The reader must
2// answer exactly as it did before: the c91c9cf implementation is kept here as the model (parseLsRefLine split the line,
3// lsRefsStep returned a copy of the state per frame), and both are run over generated lines and frame sequences. The
4// cases after it pin each branch of the new code for the mutation gate, and lsRefs stops reading at the first ref past
5// maxRefs.
6import { test } from 'vitest';
7import assert from 'node:assert/strict';
8import { parseLsRefLine, parseUnbornLine, lsInit, lsRefsStep, lsRefsEnd, lsRefs } from '../src/lsrefs.js';
9import { decodeBytes, te } from '../src/bytes.js';
10import { DEFAULT_LIMITS, withLimits } from '../src/limits.js';
11import { none, some } from '../src/result.js';
13// ---- the model: src/lsrefs.ts at c91c9cf, with parseOid's rule spelled out (40 lowercase hex after lowercasing) ----
14const R_OK = (value) => ({ ok: true, value });
15const R_ERR = (code, message, extra = {}) => ({ ok: false, error: { code, message, ...extra } });
16// SAFETY.md "Remote text": an ERR message carries no control character and no lone surrogate; each is written as its
17// UTF-16 unit, \uXXXX (tab and newline stay). Stated here by code-unit ranges, not with the helper under test.
18const shownModel = s => s.replace(/[\u0000-\u0008\u000b-\u001f\u007f-\u009f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g, c => `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`);
19const malformed = (line) => R_ERR('protocol', `ls-refs: malformed line ${JSON.stringify(line.slice(0, 60))}`);
20const sha1Model = (text) => { const l = text.toLowerCase(); return /^[0-9a-f]{40}$/.test(l) ? l : null; };
21function parseModel(line) {
22 if (line.startsWith('ERR ')) return R_ERR('remote_error', `remote: ${shownModel(line.slice(4))}`);
23 const sp = line.indexOf(' ');
24 if (sp < 0) return malformed(line);
25 const oid = line.slice(0, sp);
26 if (oid === 'unborn') return R_OK(null);
27 const rest = line.slice(sp + 1);
28 const cut = rest.indexOf(' ');
29 const name = cut < 0 ? rest : rest.slice(0, cut);
30 const attrs = cut < 0 ? [] : rest.slice(cut + 1).split(' ');
31 if (/^[0-9a-fA-F]{64}$/.test(oid)) return R_ERR('unsupported', 'unsupported object-format: only sha1 repositories are supported');
32 const parsed = sha1Model(oid);
33 if (parsed === null) return malformed(line);
34 const rec = { oid: parsed, name, peeled: null, 'symref-target': null };
35 for (const a of attrs) {
36 const colon = a.indexOf(':');
37 if (colon < 0) continue;
38 const key = a.slice(0, colon), value = a.slice(colon + 1);
39 if (key === 'peeled') {
40 const peeled = sha1Model(value);
41 if (peeled === null) return malformed(line);
42 rec[key] = peeled;
43 } else if (key === 'symref-target') rec[key] = value;
44 }
45 return R_OK(rec);
46}
47const limitModel = (what, got, max) => R_ERR('limit_exceeded', `${what} ${got} exceeds limit ${max}`, { what, got, max });
48function stepModel(st, f, caps) {
49 if (st.tag === 'ended') return R_ERR('protocol', `ls-refs: ${f.kind} after the terminating flush-pkt`);
50 if (f.kind === 'flush') return R_OK({ ...st, tag: 'ended' });
51 if (f.kind !== 'data') return R_ERR('protocol', `ls-refs: unexpected ${f.kind} in ref listing`);
52 const bytes = st.bytes + f.payload.length;
53 if (bytes > caps.maxBytes) return limitModel('ls-refs bytes', bytes, caps.maxBytes);
54 const line = decodeBytes(f.payload).replace(/\n$/, '');
55 const parsed = parseModel(line);
56 if (!parsed.ok) return parsed;
57 const rec = parsed.value;
58 if (rec === null) {
59 const unborn = caps.unborn.tag === 'some' && caps.unborn.value ? caps.unborn.value(line, st.unborn) : st.unborn;
60 return R_OK({ ...st, bytes, unborn });
61 }
62 if (st.refs.has(rec.name)) return R_OK({ ...st, bytes });
63 let { counted } = st;
64 if (rec.name !== 'HEAD') {
65 if (counted >= caps.maxRefs) return limitModel('ls-refs lines', counted + 1, caps.maxRefs);
66 counted += 1;
67 }
68 st.refs.set(rec.name, rec);
69 const head = rec.name === 'HEAD' && rec['symref-target'] ? rec['symref-target'] : st.head;
70 return R_OK({ ...st, bytes, counted, head });
71}
73// A Result as plain data: an Ok's value as given, an Err as the error's code, message and limit fields.
74const errShape = (e) => ({ code: e.code, message: e.message, ...('what' in e ? { what: e.what } : {}), ...('got' in e ? { got: e.got, max: e.max } : {}) });
75const shape = (r) => (r.ok ? R_OK(r.value) : { ok: false, error: errShape(r.error) });
76const listing = (st) => ({ tag: st.tag, refs: [...st.refs.entries()], counted: st.counted, bytes: st.bytes, head: st.head, unborn: st.unborn });
78function prng(seed) {
79 let s = seed >>> 0 || 1;
80 return () => { s ^= s << 13; s >>>= 0; s ^= s >>> 17; s ^= s << 5; s >>>= 0; return s; };
81}
82const A = 'ab'.repeat(20), B = '0123456789'.repeat(4);
83// Fields chosen at the edges of each rule: oids of either case, 64-hex, 39/41 chars, a non-ASCII letter that
84// lowercases to two code units (U+0130) or to ASCII (U+212A KELVIN SIGN), every key spelling near the two kept ones.
85const FIELDS = [
86 A, B, A.toUpperCase(), `${A.slice(0, 20)}${A.slice(20).toUpperCase()}`, 'ab'.repeat(32), 'AB'.repeat(32), A.slice(1), `${A}0`,
87 `İ${A.slice(2)}`, `K${A.slice(1)}`, 'unborn', 'ERR', 'HEAD', 'refs/heads/main', 'refs/tags/v1', '',
88 `peeled:${B}`, `peeled:${A.toUpperCase()}`, 'peeled:', 'peeled:junk', `peeled:${B}:`, 'peeled', `peeled_:${B}`, `Peeled:${B}`, `xpeeled:${B}`,
89 'symref-target:refs/heads/main', 'symref-target:', 'symref-target', 'symref-target::a:b', 'symref-targetx:y', ':', ':peeled',
90 'a:b', '__proto__:x', 'capabilities^{}', 'été',
91];
92const SEPARATORS = [' ', ' ', ' ', ' ', ''];
93function genLine(r) {
94 const n = r() % 6;
95 let line = r() % 7 === 0 ? 'ERR ' : '';
96 for (let i = 0; i < n; i++) {
97 // the first field is mostly an oid, so most lines reach the name and attribute rules
98 const f = i === 0 && r() % 3 > 0 ? FIELDS[r() % 4] : FIELDS[r() % FIELDS.length];
99 line += (i > 0 ? SEPARATORS[r() % SEPARATORS.length] : '') + f;
100 }
101 if (r() % 9 === 0) line += ' ';
102 return line;
103}
105test('parseLsRefLine answers as the c91c9cf parser on 20,000 generated lines', () => {
106 const r = prng(209);
107 const seen = new Set();
108 for (let i = 0; i < 20_000; i++) {
109 const line = genLine(r);
110 const got = shape(parseLsRefLine(line)), want = parseModel(line);
111 assert.deepEqual(got, want, JSON.stringify(line));
112 seen.add(want.ok ? (want.value === null ? 'unborn' : `ok:${want.value.peeled !== null}:${want.value['symref-target'] !== null}`) : want.error.code);
113 }
114 // every outcome the parser has was reached
115 for (const k of ['unborn', 'ok:false:false', 'ok:true:false', 'ok:false:true', 'ok:true:true', 'remote_error', 'protocol', 'unsupported']) assert.ok(seen.has(k), k);
116});
118test('lsRefsStep answers as the c91c9cf step on 3,000 generated frame sequences', () => {
119 const r = prng(20_261_106);
120 const readers = [none, some(null), some(parseUnbornLine)];
121 const lines = [
122 `${A} HEAD symref-target:refs/heads/main`, `${A} HEAD`, `${B} HEAD symref-target:`, `${A} HEAD symref-target:refs/heads/other`,
123 `${A} refs/heads/main`, `${B} refs/heads/main`, `${A} refs/heads/HEAD`, `${B} refs/tags/v1 peeled:${A}`,
124 'unborn HEAD symref-target:refs/heads/main', 'unborn HEAD symref-target:', 'unborn refs/heads/x symref-target:y', 'unborn HEAD',
125 `${A} refs/heads/é`, 'ERR denied', `${A}`, `${'ab'.repeat(32)} HEAD`,
126 ];
127 const frame = () => {
128 const k = r() % 40;
129 if (k === 0) return { kind: 'flush' };
130 if (k === 1) return { kind: 'delim' };
131 if (k === 2) return { kind: 'end' };
132 const text = k < 10 ? `${A} refs/pull/${r() % 12}/head` : lines[r() % lines.length];
133 const bytes = te.encode(r() % 4 === 0 ? text : `${text}\n`);
134 // a stray byte that is no UTF-8: decodeBytes keeps it as an escape, before the LF and at the end
135 return { kind: 'data', payload: r() % 13 === 0 ? Uint8Array.from([...bytes.slice(0, -1), 0xff, ...bytes.slice(-1)]) : bytes };
136 };
137 let refused = 0, ended = 0;
138 for (let s = 0; s < 3000; s++) {
139 const frames = Array.from({ length: 1 + (r() % 14) }, frame);
140 if (r() % 2 === 0) frames.push({ kind: 'flush' });
141 const maxBytes = r() % 3 === 0 ? 40 + (r() % 400) : 1 << 20;
142 const caps = { maxBytes, maxRefs: r() % 6, unborn: readers[r() % readers.length] };
143 let st = lsInit(), model = lsInit();
144 let stopped = false;
145 for (const f of frames) {
146 const got = lsRefsStep(st, f, caps), want = stepModel(model, f, caps);
147 assert.equal(got.ok, want.ok, JSON.stringify(frames.map(x => x.kind)));
148 if (!want.ok) { assert.deepEqual(errShape(got.error), want.error); stopped = true; refused++; break; }
149 // the step returns the listing it was given, updated
150 assert.equal(got.value, st);
151 st = got.value; model = want.value;
152 assert.deepEqual(listing(st), listing(model));
153 }
154 if (stopped) continue;
155 const got = lsRefsEnd(st), want = lsRefsEnd(model);
156 assert.deepEqual(shape(got), shape(want));
157 if (want.ok) ended++;
158 }
159 assert.ok(refused > 500 && ended > 200, `${refused} refused, ${ended} ended`);
160});
162// ---- the branches, one by one ----
163const caps = (o = {}) => ({ maxBytes: 1 << 20, maxRefs: 10, unborn: none, ...o });
164const data = (s) => ({ kind: 'data', payload: te.encode(s) });
165const len = (s) => te.encode(s).length;
166function run(lines, c = caps()) {
167 const st = lsInit();
168 for (const l of lines) {
169 const r = lsRefsStep(st, typeof l === 'string' ? data(l) : l, c);
170 if (!r.ok) return { st, error: r.error };
171 }
172 return { st, error: null };
173}
175test('parseLsRefLine: each field rule, read by index', () => {
176 const v = (line) => { const r = parseLsRefLine(line); assert.ok(r.ok, line); return r.value; };
177 assert.deepEqual(v(`${A} refs/heads/a`), { oid: A, name: 'refs/heads/a', peeled: null, 'symref-target': null });
178 // the name ends at the first space; the attribute values run to the next space or the end
179 assert.deepEqual(v(`${A} r peeled:${B} symref-target:t`), { oid: A, name: 'r', peeled: B, 'symref-target': 't' });
180 assert.deepEqual(v(`${A} r symref-target:t peeled:${B}`), { oid: A, name: 'r', peeled: B, 'symref-target': 't' });
181 assert.deepEqual(v(`${A} r symref-target:t:u x`), { oid: A, name: 'r', peeled: null, 'symref-target': 't:u' });
182 assert.deepEqual(v(`${A} r symref-target:`), { oid: A, name: 'r', peeled: null, 'symref-target': '' });
183 assert.deepEqual(v(`${A} r symref-target:a symref-target:b`)['symref-target'], 'b', 'the last one wins');
184 assert.deepEqual(v(`${A} r peeled:${A} peeled:${B}`).peeled, B, 'the last one wins');
185 assert.deepEqual(v(`${A} r peeled:${A.toUpperCase()}`).peeled, A, 'a peeled oid of either case, kept lowercase');
186 assert.deepEqual(v(`${A.toUpperCase()} r`).oid, A);
187 assert.deepEqual(v(`${A} r symref-target:t `), { oid: A, name: 'r', peeled: null, 'symref-target': 't' }, 'empty fields skipped');
188 assert.deepEqual(v(`${A} r x:symref-target:t`)['symref-target'], null, 'the key is the text before the first colon');
189 assert.deepEqual(v(`${A} r ysymref-target:t zpeeled:${B}`), { oid: A, name: 'r', peeled: null, 'symref-target': null });
190 assert.deepEqual(v(`${A} r`).name, '', 'a doubled space: the name is the empty field');
191 assert.deepEqual(v(`${A} `).name, '');
192 assert.deepEqual(v(`${A} peeled:${B}`), { oid: A, name: `peeled:${B}`, peeled: null, 'symref-target': null }, 'the second field is the name, whatever it says');
193 // a malformed peeled oid anywhere in the line, and a sha256 oid against everything else that is not 40 hex
194 for (const line of [`${A} r peeled:${A}0`, `${A} r peeled:`, `${A} r symref-target:t peeled:x y`]) {
195 assert.deepEqual(shape(parseLsRefLine(line)), malformed(line), line);
196 }
197 assert.equal(parseLsRefLine(`${'AB'.repeat(32)} r`).error.code, 'unsupported');
198 assert.deepEqual(shape(parseLsRefLine(`${'ab'.repeat(31)} r`)), malformed(`${'ab'.repeat(31)} r`));
199 assert.deepEqual(shape(parseLsRefLine(`İ${A.slice(2)} r`)), malformed(`İ${A.slice(2)} r`), 'lowercases to 40 code units, not 40 hex digits');
200});
202test('lsRefsStep: one listing, updated in place; a refusal changes nothing', () => {
203 const st = lsInit();
204 const c = caps({ maxRefs: 2 });
205 const first = lsRefsStep(st, data(`${A} HEAD symref-target:refs/heads/main\n`), c);
206 assert.equal(first.value, st);
207 const headBytes = len(`${A} HEAD symref-target:refs/heads/main\n`);
208 assert.deepEqual(listing(st), { tag: 'open', refs: [['HEAD', { oid: A, name: 'HEAD', peeled: null, 'symref-target': 'refs/heads/main' }]], counted: 0, bytes: headBytes, head: 'refs/heads/main', unborn: null });
209 assert.equal(lsRefsStep(st, data(`${A} refs/heads/a\n`), c).value, st);
210 assert.equal(lsRefsStep(st, data(`${A} refs/heads/HEAD\n`), c).value, st);
211 assert.deepEqual([st.counted, st.bytes, st.refs.size], [2, headBytes + len(`${A} refs/heads/a\n`) + len(`${A} refs/heads/HEAD\n`), 3]);
212 const before = listing(st);
213 const refused = lsRefsStep(st, data(`${A} refs/heads/b\n`), c);
214 assert.deepEqual(errShape(refused.error), { code: 'limit_exceeded', message: 'ls-refs lines 3 exceeds limit 2', what: 'ls-refs lines', got: 3, max: 2 });
215 assert.deepEqual(listing(st), before);
216 const ended = lsRefsStep(st, { kind: 'flush' }, c);
217 assert.equal(ended.value, st);
218 assert.equal(st.tag, 'ended');
219 assert.deepEqual(lsRefsEnd(st).value, { refs: st.refs, head: 'refs/heads/main', unborn: null });
220 assert.equal(lsRefsStep(st, data(`${A} refs/heads/b\n`), c).error.message, 'ls-refs: data after the terminating flush-pkt');
221});
223test('lsRefsStep: maxRefs counts names other than HEAD, at the boundary', () => {
224 const refs = (n) => Array.from({ length: n }, (_, i) => `${A} refs/heads/b${i}\n`);
225 assert.equal(run([...refs(3), `${A} HEAD\n`], caps({ maxRefs: 3 })).error, null, 'exactly maxRefs, and HEAD beside them');
226 assert.equal(run([`${A} HEAD\n`, ...refs(3)], caps({ maxRefs: 3 })).st.counted, 3);
227 const over = run([...refs(4), `${A} HEAD\n`], caps({ maxRefs: 3 }));
228 assert.deepEqual([over.error.what, over.error.got, over.error.max, over.st.counted, over.st.refs.size], ['ls-refs lines', 4, 3, 3, 3]);
229 assert.equal(run([`${A} HEAD\n`], caps({ maxRefs: 0 })).error, null, 'HEAD alone, under maxRefs 0');
230 assert.equal(run([`${A} refs/heads/HEAD\n`], caps({ maxRefs: 0 })).error.got, 1, 'refs/heads/HEAD is a branch');
231 // a name listed twice is read once and counted once; its bytes still count
232 const dup = run([...refs(2), `${B} refs/heads/b0\n`], caps({ maxRefs: 2 }));
233 assert.deepEqual([dup.error, dup.st.counted, dup.st.refs.get('refs/heads/b0').oid, dup.st.bytes], [null, 2, A, 3 * len(`${A} refs/heads/b0\n`)]);
234});
236test('lsRefsStep: maxBytes counts every data frame, the duplicate and the unborn lines too, at the boundary', () => {
237 const lines = [`${A} refs/heads/a\n`, `${B} refs/heads/a\n`, 'unborn HEAD symref-target:refs/heads/main\n', `${A} HEAD\n`];
238 const total = lines.reduce((n, l) => n + te.encode(l).length, 0);
239 for (const unborn of [none, some(parseUnbornLine)]) {
240 assert.equal(run(lines, caps({ maxBytes: total, unborn })).error, null);
241 assert.equal(run(lines, caps({ maxBytes: total, unborn })).st.bytes, total);
242 const over = run(lines, caps({ maxBytes: total - 1, unborn })).error;
243 assert.deepEqual([over.what, over.got, over.max], ['ls-refs bytes', total, total - 1]);
244 }
245});
247test('lsRefsStep: HEAD names the symref target only when it has one; the first HEAD is the one kept', () => {
248 assert.equal(run([`${A} HEAD symref-target:refs/heads/main`]).st.head, 'refs/heads/main');
249 assert.equal(run([`${A} HEAD`]).st.head, null);
250 assert.equal(run([`${A} HEAD symref-target:`]).st.head, null);
251 assert.equal(run([`${A} HEAD symref-target:refs/heads/a`, `${A} HEAD symref-target:refs/heads/b`]).st.head, 'refs/heads/a');
252 assert.equal(run([`${A} refs/heads/x symref-target:refs/heads/a`]).st.head, null, 'only HEAD names it');
253});
255test('lsRefsStep: an unborn line goes to the reader the caller passed, and to no other', () => {
256 const line = 'unborn HEAD symref-target:refs/heads/main\n';
257 assert.deepEqual(run([line], caps({ unborn: some(parseUnbornLine) })).st.unborn, { name: 'HEAD', target: 'refs/heads/main' });
258 assert.equal(run([line], caps({ unborn: some(null) })).st.unborn, null);
259 assert.equal(run([line], caps({ unborn: none })).st.unborn, null);
260 const seen = [];
261 const reader = (l, prev) => { seen.push([l, prev]); return { name: 'HEAD', target: `t${seen.length}` }; };
262 assert.deepEqual(run([line, `${line.trim()} x`], caps({ unborn: some(reader) })).st.unborn, { name: 'HEAD', target: 't2' });
263 assert.deepEqual(seen, [[line.trim(), null], [`${line.trim()} x`, { name: 'HEAD', target: 't1' }]], 'the line without its LF, and the previous answer');
264 assert.equal(run([line], caps({ unborn: some(reader) })).st.refs.size, 0);
265});
267test('lsRefsStep: only the one trailing LF comes off', () => {
268 assert.equal(run([`${A} refs/heads/a`]).st.refs.has('refs/heads/a'), true, 'no LF: the line as it is');
269 assert.equal(run([`${A} refs/heads/a\n`]).st.refs.has('refs/heads/a'), true);
270 assert.equal(run([`${A} refs/heads/a\n\n`]).st.refs.has('refs/heads/a\n'), true, 'the second LF is the name\'s');
271 assert.equal(run([`${A} r symref-target:t\r\n`]).st.refs.get('r')['symref-target'], 't\r');
272 assert.equal(run([`${A} refs/heads/a \n`]).st.refs.has('refs/heads/a '), true);
273});
275// lsRefs reads the listing as the frames arrive and stops at the first ref past maxRefs: the frames after it are never
276// pulled from the transport (the 413 a large listing gets is decided at ref maxRefs + 1, not after the whole answer).
277test('lsRefs stops reading at the first ref past maxRefs, and at the frame past maxLsRefsBytes', async () => {
278 const spanStub = { set() {}, event() {}, error() {} };
279 const pulled = { n: 0, closed: false };
280 const transport = (limits, n) => ({
281 limits, tracer: { span: async (_name, _opts, fn) => fn(spanStub) }, parent: null,
282 async *frames() {
283 try {
284 yield data(`${A} HEAD symref-target:refs/heads/b0\n`); pulled.n++;
285 for (let i = 0; i < n; i++) { yield data(`${A} refs/heads/b${i}\n`); pulled.n++; }
286 yield { kind: 'flush' };
287 } finally { pulled.closed = true; }
288 },
289 });
290 const headLen = len(`${A} HEAD symref-target:refs/heads/b0\n`), refLen = len(`${A} refs/heads/b0\n`);
291 const refused = await lsRefs(transport(withLimits({ maxRefs: 5 }), 1000));
292 assert.deepEqual(errShape(refused.error), { code: 'limit_exceeded', message: 'ls-refs lines 6 exceeds limit 5', what: 'ls-refs lines', got: 6, max: 5 });
293 assert.deepEqual(pulled, { n: 6, closed: true }, 'HEAD and five refs read, the sixth refused as it arrived, the stream closed');
294 pulled.n = 0; pulled.closed = false;
295 const listed = await lsRefs(transport(withLimits({ maxRefs: 5 }), 5));
296 assert.deepEqual([listed.ok, listed.value.refs.size, listed.value.head], [true, 6, 'refs/heads/b0']);
297 pulled.n = 0; pulled.closed = false;
298 const bytes = await lsRefs(transport(withLimits({ maxLsRefsBytes: headLen + 2 * refLen }), 1000));
299 assert.deepEqual([bytes.error.what, bytes.error.got, pulled.n, pulled.closed], ['ls-refs bytes', headLen + 3 * refLen, 3, true]);
300 assert.equal(DEFAULT_LIMITS.maxRefs, 10_000);
301});
Diagnostics6 git calls · 122 ms
CallStatusSizeTime0122 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=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 KiB2 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=UPDATING 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 · hit3 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=3 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=10Open 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=5323b9266eea5ded637285d1c5320699f12be76eOpen 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=113 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=be7e0453974a5fe832f9065a33bb7e3434c10e9bOpen pack map
fetch2005.9 KiB113 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=6062 git.response.cache=MISS git.response.duration_ms=113 git.fetch.wants=5b90a05c6ac151029b2356e45b7de215df319e11 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=6062 git.pkt.payload.max=6035 git.sideband.band1.bytes=6035 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
- a5e171a10af96102
- Request
- 1c1cd7fb…
- 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