GitHubivarvong

ply

main
ply6 git calls116 ms29 KiB4 cachedprotocol v2
310 lines21 KiBRaw
1// #218: readFile / listTree fetch the commit and the path's first two tree levels in one request where the server takes
2// `combine:blob:none+tree:K`. git is the oracle for every answer (`git show`, `git ls-tree`); the proxy in front of git
3// http-backend counts the requests and the filters they carry. Servers: git with uploadpack.allowFilter (takes it), git
4// configured as GitHub is (uploadpackfilter.tree.maxDepth=0, uploadpackfilter.combine.allow=false: GitHub's two refusals,
5// byte for byte), git with maxDepth=1, an Artifacts-like proxy (every filter but blob:none is a 400), and a proxy that
6// lies in the deep pack (each lie falls back to the tree:0 walk and still answers what git says).
7import { test, beforeAll as before, afterAll as after } from 'vitest';
8import assert from 'node:assert/strict';
9import { join } from 'node:path';
10import { mkdirSync } from 'node:fs';
11import { git, gitBuf, tmpRoot, makeBareRepo, startGitServer, commitFiles, initRepo } from './server.js';
12import { startProxy } from './proxy.js';
13import { readFile, listTree, walkCommit } from '../src/read.js';
14import { createTransport } from '../src/http.js';
15import { fetchObject } from '../src/fetch.js';
16import { buildPack } from '../src/pack.js';
17import { pkt, FLUSH } from '../src/pktline.js';
18import { concat } from '../src/bytes.js';
19import { TYPE } from '../src/objects.js';
20import { Tracer, arrayExporter, flattenLine } from '../src/otel.js';
21import { PATH_TREE_LEVELS, pathTreesFilter, isPathTreesRefusal } from '../src/pathtrees.js';
22import { unwrap, unwrapAsync } from './unwrap.js';
24const filterOf = body => /filter ([^\n]+)\n/.exec(Buffer.from(body).toString('latin1'))?.[1] ?? null;
25const drain = async stream => { const parts = []; for await (const c of stream) parts.push(Buffer.from(c)); return Buffer.concat(parts); };
26const lsTree = (bare, spec) => git(bare, ['ls-tree', '-z', spec]).split('\0').filter(Boolean).map(l => { const [meta, name] = l.split('\t'); const [mode, type, oid] = meta.split(' '); return { name, mode, oid, type }; });
28const FILES = { 'README.md': '# root\n', 'a/x.txt': 'one\n', 'a/b/y.txt': 'two\n', 'a/b/c/z.txt': 'three\n', 'a/b/c/d/w.txt': 'four\n', 'q/r.txt': 'sibling\n' };
29for (let i = 0; i < 12; i++) FILES[`wide/d${i}/f.txt`] = `f${i}\n`;
30const READS = ['README.md', 'a/x.txt', 'a/b/y.txt', 'a/b/c/z.txt', 'a/b/c/d/w.txt'];
31const LISTS = ['', 'a', 'a/b', 'a/b/c'];
32const depth = p => (p === '' ? 0 : p.split('/').length);
33// Round trips of a warm read on a server that takes the deep fetch: ls-refs, the commit with the first
34// min(levels, PATH_TREE_LEVELS) tree levels, one fetch per level past them, and the blob for readFile.
35const deepReadRequests = p => 1 + 1 + Math.max(0, depth(p) - PATH_TREE_LEVELS) + 1;
36const deepListRequests = p => 1 + 1 + Math.max(0, depth(p) + 1 - PATH_TREE_LEVELS);
37// ... and on one that does not (today's walk): ls-refs, the commit, one tree per level, the blob.
38const narrowReadRequests = p => 1 + 1 + depth(p) + 1;
39const narrowListRequests = p => 1 + 1 + depth(p) + 1;
41let root, cleanup, srv, n = 0;
42before(async () => { ({ root, cleanup } = tmpRoot()); srv = await startGitServer(root); });
43after(async () => { await srv.close(); cleanup(); });
45// A repository behind a recording proxy. `config`: upload-pack settings on top of makeBareRepo's. `lie(ctx)`: a fault
46// for a deep fetch's answer (or null to pass it).
47async function repo({ config = [], fault = null } = {}) {
48 const name = `p${n++}`; const bare = makeBareRepo(root, name); const work = join(root, `w${name}`); mkdirSync(work); initRepo(work);
49 for (const [k, v] of config) git(bare, ['config', k, v]);
50 commitFiles(work, bare, FILES, 'seed');
51 const seen = [];
52 const proxy = await startProxy(srv.url, ctx => {
53 if (ctx.phase === 'request') return fault ? fault(ctx) : null;
54 seen.push({ stage: ctx.stage, filter: filterOf(ctx.reqBody), status: ctx.status });
55 return fault ? fault(ctx) : { type: 'pass' };
56 });
57 return { bare, url: `${proxy.url}/${name}.git`, proxy, seen, mark: () => seen.length };
59const since = (r, at) => r.seen.slice(at);
60const deepFilters = reqs => reqs.filter(s => typeof s.filter === 'string' && s.filter.startsWith('combine:'));
62async function checkRead(r, path, opts) {
63 const got = await unwrapAsync(readFile(r.url, { path }, opts));
64 assert.deepEqual(await drain(got.stream), gitBuf(r.bare, ['show', `main:${path}`]), path);
65 assert.equal(got.blob, git(r.bare, ['rev-parse', `main:${path}`]).trim());
67async function checkList(r, path, opts) {
68 const got = await unwrapAsync(listTree(r.url, { path }, opts));
69 assert.deepEqual(got.entries.map(e => [e.name, e.mode, e.oid, e.type]), lsTree(r.bare, path === '' ? 'main' : `main:${path}`).map(e => [e.name, e.mode, e.oid, e.type]), path || '/');
72test('pathTreesFilter: the levels a walk reads, capped at PATH_TREE_LEVELS', () => {
73 assert.equal(PATH_TREE_LEVELS, 2);
74 assert.equal(pathTreesFilter(1), 'combine:blob:none+tree:1');
75 assert.equal(pathTreesFilter(2), 'combine:blob:none+tree:2');
76 assert.equal(pathTreesFilter(7), 'combine:blob:none+tree:2');
77});
79test('a server that takes it: first contact is tree:0, then one race, then the deep fetch alone; every answer is git\'s', async () => {
80 const r = await repo();
81 try {
82 const quirks = {}; const tracer = new Tracer();
83 // 1: nothing known: the tree:0 walk (tree:0 is settled by it)
84 let at = r.mark(); await checkRead(r, 'a/b/y.txt', { tracer, quirks });
85 assert.equal(since(r, at).length, narrowReadRequests('a/b/y.txt'));
86 assert.equal(deepFilters(since(r, at)).length, 0, 'no deep fetch before tree:0 is known to be taken');
87 // 2: tree:0 taken, the deep fetch not known: both commit fetches, concurrently; the deep one wins
88 at = r.mark(); await checkRead(r, 'a/b/y.txt', { tracer, quirks });
89 assert.equal(since(r, at).length, deepReadRequests('a/b/y.txt') + 1, 'the race adds the tree:0 commit fetch');
90 assert.deepEqual(deepFilters(since(r, at)).map(s => s.filter), ['combine:blob:none+tree:2']);
91 // 3+: taken: the deep fetch alone, every depth, readFile and listTree
92 for (const p of READS) {
93 at = r.mark(); await checkRead(r, p, { tracer, quirks });
94 assert.equal(since(r, at).length, deepReadRequests(p), `readFile ${p}`);
95 assert.deepEqual(deepFilters(since(r, at)).map(s => s.filter), [pathTreesFilter(depth(p))], `readFile ${p}`);
96 assert.equal(since(r, at).filter(s => s.filter === 'tree:0').length, Math.max(0, depth(p) - PATH_TREE_LEVELS), `readFile ${p}: tree:0 only past the deep levels`);
97 }
98 for (const p of LISTS) {
99 at = r.mark(); await checkList(r, p, { tracer, quirks });
100 assert.equal(since(r, at).length, deepListRequests(p), `listTree ${p || '/'}`);
101 assert.deepEqual(deepFilters(since(r, at)).map(s => s.filter), [pathTreesFilter(depth(p) + 1)], `listTree ${p || '/'}`);
102 }
103 assert.equal(quirks.treeFilter, 'tree:0', 'the public record is unchanged by what was learned');
104 assert.deepEqual(Object.keys(quirks).toSorted(), ['blobWants', 'treeFilter']);
105 } finally { await r.proxy.close(); }
106});
108test('walkCommit (#222): the commit and the path\'s first two levels in one fetch, the rest per level; git is the oracle', async () => {
109 const r = await repo();
110 try {
111 const quirks = {}; const tracer = new Tracer();
112 const head = git(r.bare, ['rev-parse', 'main']).trim();
113 const rev = spec => git(r.bare, ['rev-parse', spec]).trim();
114 const t = unwrap(createTransport(r.url, { tracer, quirks }));
115 // first contact: nothing known, so the commit (tree:0) and one tree per level, as readFile's first walk
116 let at = r.mark();
117 let cache = new Map();
118 const cold = await unwrapAsync(walkCommit(t, head, ['a', 'b'], { cache }));
119 assert.deepEqual(since(r, at).map(s => s.filter), ['tree:0', 'tree:0', 'tree:0']);
120 assert.equal(cold.entry.oid, rev('main:a/b'));
121 // tree:0 is now known to be taken: the deep fetch races the commit's tree:0 fetch once and is learned
122 await unwrapAsync(walkCommit(t, head, ['a'], { cache: new Map() }));
123 at = r.mark(); cache = new Map();
124 const w = await unwrapAsync(walkCommit(t, head, ['a', 'b'], { cache }));
125 assert.deepEqual(since(r, at).map(s => s.filter), ['combine:blob:none+tree:2'], 'one request: the commit, the root and a/');
126 assert.equal(w.commit, head);
127 assert.deepEqual(Buffer.from(w.data), gitBuf(r.bare, ['cat-file', 'commit', head]));
128 assert.equal(w.tree, rev('main^{tree}'));
129 assert.deepEqual([w.entry.name, w.entry.mode, w.entry.oid], ['b', '40000', rev('main:a/b')]);
130 assert.deepEqual([...cache.keys()].toSorted(), [rev('main^{tree}'), rev('main:a')].toSorted());
131 assert.deepEqual(Buffer.from(cache.get(rev('main:a'))), gitBuf(r.bare, ['cat-file', 'tree', rev('main:a')]));
132 // a depth-1 tree the walk did not read came with the commit: fetchObject answers it without a request
133 at = r.mark();
134 const sibling = await unwrapAsync(fetchObject(t, { oid: rev('main:q'), filter: 'tree:0' }));
135 assert.deepEqual(Buffer.from(sibling.data), gitBuf(r.bare, ['cat-file', 'tree', rev('main:q')]));
136 assert.equal(since(r, at).length, 0);
137 // levels: the default is comps.length + 1 (root listing: tree:1), 0 is the commit alone (its root tree is still in the
138 // transport's harvest from the deep fetches above), past 2 is capped at 2
139 for (const [comps, levels, filters] of [
140 [[], undefined, ['combine:blob:none+tree:1']],
141 [['a'], 0, ['tree:0']],
142 [['a', 'b', 'c', 'd'], undefined, ['combine:blob:none+tree:2', 'tree:0', 'tree:0']],
143 [['a', 'b', 'c', 'd'], 9, ['combine:blob:none+tree:2', 'tree:0', 'tree:0']],
144 [['a'], 1, ['combine:blob:none+tree:1']],
145 ]) {
146 at = r.mark();
147 const got = await unwrapAsync(walkCommit(t, head, comps, { cache: new Map(), levels }));
148 assert.deepEqual(since(r, at).map(s => s.filter), filters, `${comps.join('/')} levels ${levels}`);
149 assert.equal(got.entry === null ? got.tree : got.entry.oid, rev(comps.length === 0 ? 'main^{tree}' : `main:${comps.join('/')}`));
150 }
151 // no options at all: the default cache and levels
152 at = r.mark();
153 assert.equal((await unwrapAsync(walkCommit(t, head, ['q']))).entry.oid, rev('main:q'));
154 assert.deepEqual(since(r, at).map(s => s.filter), ['combine:blob:none+tree:2']);
155 // a missing component is walkPath's not_found, with its miss
156 const missing = await walkCommit(t, head, ['a', 'nope']);
157 assert.equal(missing.ok, false);
158 assert.equal(missing.error.code, 'not_found');
159 assert.deepEqual(missing.error.miss, { kind: 'path', missing: 'nope', existingPath: 'a' });
160 // refused before any request: an oid that is not 40 hex, levels that is not a non-negative integer
161 at = r.mark();
162 for (const [oid, levels] of [['HEAD', 1], [head.slice(1), 1], [head, -1], [head, 1.5], [head, Number.NaN], [head, '2']]) {
163 const bad = await walkCommit(t, oid, ['a'], { levels });
164 assert.equal(bad.ok, false, `${oid} ${levels}`);
165 assert.equal(bad.error.code, 'bad_request', `${oid} ${levels}`);
166 }
167 assert.match((await walkCommit(t, head, [], { levels: -1 })).error.message, /^walkCommit: levels must be a non-negative integer, got -1$/);
168 assert.equal(since(r, at).length, 0);
169 // a blob is not a commit
170 const notCommit = await walkCommit(t, rev('main:README.md'), []);
171 assert.equal(notCommit.ok, false);
172 } finally { await r.proxy.close(); }
173});
175test('a server configured as GitHub (combine refused, tree depth 0): one refused request in the race, then today\'s walk', async () => {
176 const r = await repo({ config: [['uploadpackfilter.tree.maxDepth', '0'], ['uploadpackfilter.combine.allow', 'false']] });
177 try {
178 const quirks = {}; const ex = arrayExporter(); const tracer = new Tracer({ exporter: ex });
179 for (let round = 0; round < 2; round++) {
180 for (const p of READS) await checkRead(r, p, { tracer, quirks });
181 for (const p of LISTS) await checkList(r, p, { tracer, quirks });
182 }
183 const deep = deepFilters(r.seen);
184 assert.equal(deep.length, 1, 'refused once, never asked again on this record');
185 // the refusal is git's ERR, inside a 200: remote_error, recognised as a refusal (isPathTreesRefusal)
186 const spans = ex.lines.flatMap(flattenLine).filter(s => s.name === 'git.upload-pack fetch' && s.attrs['git.fetch.filter'] === deep[0].filter);
187 assert.equal(spans.length, 1);
188 assert.equal(spans[0].attrs['error.type'], 'remote_error');
189 // after the race every read is today's: no more requests than the tree:0 walk
190 const at = r.mark();
191 for (const p of READS) await checkRead(r, p, { tracer, quirks });
192 for (const p of LISTS) await checkList(r, p, { tracer, quirks });
193 assert.equal(since(r, at).length, READS.reduce((s, p) => s + narrowReadRequests(p), 0) + LISTS.reduce((s, p) => s + narrowListRequests(p), 0));
194 } finally { await r.proxy.close(); }
195});
197test('a server whose tree depth is capped at 1: a K=2 refusal is learned as refused, answers stay git\'s', async () => {
198 const r = await repo({ config: [['uploadpackfilter.tree.maxDepth', '1']] });
199 try {
200 const quirks = {}; const tracer = new Tracer();
201 await checkRead(r, 'README.md', { tracer, quirks }); // settles tree:0
202 await checkRead(r, 'README.md', { tracer, quirks }); // race, K = 1: taken
203 let at = r.mark(); await checkRead(r, 'README.md', { tracer, quirks });
204 assert.equal(since(r, at).length, deepReadRequests('README.md'));
205 // K = 2 is past the cap: refused (git: "tree filter allows max depth 1, but got 2"), the walk falls back
206 at = r.mark(); await checkRead(r, 'a/b/y.txt', { tracer, quirks });
207 assert.deepEqual(since(r, at).map(s => s.filter).filter(Boolean)[0], 'combine:blob:none+tree:2');
208 at = r.mark(); await checkRead(r, 'README.md', { tracer, quirks });
209 assert.equal(deepFilters(since(r, at)).length, 0, 'one bit per record: refused for every K from then on');
210 assert.equal(since(r, at).length, narrowReadRequests('README.md'));
211 } finally { await r.proxy.close(); }
212});
214test('an Artifacts-like server (only blob:none): never asked for the deep fetch; one 400 per record, as #136', async () => {
215 const REJECT = 'Unsupported Git fetch filter; only blob:none is supported.';
216 const r = await repo({ fault: ctx => (ctx.phase !== 'request' && ctx.stage === 'fetch' && filterOf(ctx.reqBody) && filterOf(ctx.reqBody) !== 'blob:none' ? { type: 'status', status: 400, contentType: 'text/plain; charset=utf-8', body: REJECT } : null) });
217 try {
218 const quirks = {}; const tracer = new Tracer();
219 for (let round = 0; round < 2; round++) {
220 for (const p of READS) await checkRead(r, p, { tracer, quirks });
221 for (const p of LISTS) await checkList(r, p, { tracer, quirks });
222 }
223 assert.equal(quirks.treeFilter, 'blob:none');
224 assert.equal(deepFilters(r.seen).length, 0);
225 assert.equal(r.seen.filter(s => s.filter === 'tree:0').length, 1, 'tree:0 refused once');
226 } finally { await r.proxy.close(); }
227});
229test('limits: a depth-1 directory over maxTreeEntries is dropped from the deep pack, and every outcome equals the tree:0 server\'s', async () => {
230 // wide/ holds 12 entries; the cap is 10. Reads beside it succeed; reads through it are limit_exceeded, as on tree:0.
231 const limits = { maxTreeEntries: 10 };
232 const outcome = async thunk => { try { const r = await unwrapAsync(thunk()); if (r.stream) await drain(r.stream); return r.entries ? `ok ${r.entries.length}` : `ok ${r.blob}`; } catch (e) { return `${e.code} ${e.what ?? ''}`; } };
233 const ops = [
234 ['read README.md', (url, o) => readFile(url, { path: 'README.md' }, { limits, ...o })],
235 ['read a/b/y.txt', (url, o) => readFile(url, { path: 'a/b/y.txt' }, { limits, ...o })],
236 ['read wide/d1/f.txt', (url, o) => readFile(url, { path: 'wide/d1/f.txt' }, { limits, ...o })],
237 ['list /', (url, o) => listTree(url, { path: '' }, { limits, ...o })],
238 ['list wide', (url, o) => listTree(url, { path: 'wide' }, { limits, ...o })],
239 ['list a', (url, o) => listTree(url, { path: 'a' }, { limits, ...o })],
240 ];
241 const deep = await repo(); const narrow = await repo({ config: [['uploadpackfilter.tree.maxDepth', '0'], ['uploadpackfilter.combine.allow', 'false']] });
242 try {
243 const answers = {};
244 for (const r of [deep, narrow]) {
245 const quirks = {}; const ex = arrayExporter(); const tracer = new Tracer({ exporter: ex });
246 for (let round = 0; round < 3; round++) for (const [name, fn] of ops) answers[`${r === deep ? 'deep' : 'narrow'} ${round} ${name}`] = await outcome(() => fn(r.url, { tracer, quirks }));
247 if (r === deep) {
248 const fetches = ex.lines.flatMap(flattenLine).filter(s => s.name === 'git.upload-pack fetch' && s.attrs['git.fetch.path_trees']);
249 assert.ok(fetches.some(s => s.attrs['git.fetch.wide.skipped'] === 1 && s.attrs['git.fetch.wide.skipped_reason'] === 'tree entries'), 'the over-limit sibling was dropped, counted on the span');
250 }
251 }
252 for (const [name] of ops) for (let round = 0; round < 3; round++) assert.equal(answers[`deep ${round} ${name}`], answers[`narrow ${round} ${name}`], `${name} round ${round}`);
253 assert.match(answers['deep 2 read wide/d1/f.txt'], /^limit_exceeded/);
254 assert.match(answers['deep 2 list wide'], /^limit_exceeded/);
255 assert.match(answers['deep 2 read a/b/y.txt'], /^ok /);
256 } finally { await deep.proxy.close(); await narrow.proxy.close(); }
257});
259test('isPathTreesRefusal: git\'s refusals, an Artifacts 400, an empty answer; not a timeout, a 500 or not_our_ref', () => {
260 const e = (code, message, extra = {}) => Object.assign(new Error(message), { code, ...extra });
261 assert.equal(isPathTreesRefusal(e('remote_error', "remote: filter 'combine' not supported")), true);
262 assert.equal(isPathTreesRefusal(e('remote_error', 'remote: tree filter allows max depth 0, but got 2')), true);
263 assert.equal(isPathTreesRefusal(e('http', 'HTTP 400 git-upload-pack: Unsupported Git fetch filter; only blob:none is supported.', { status: 400 })), true);
264 assert.equal(isPathTreesRefusal(e('protocol', 'v2: response ended without flush', { reason: 'empty_response' })), true);
265 assert.equal(isPathTreesRefusal(e('timeout', 'request timed out')), false);
266 assert.equal(isPathTreesRefusal(e('http', 'HTTP 500 tree filter allows max depth 0', { status: 500 })), false);
267 assert.equal(isPathTreesRefusal(e('remote_error', 'remote: upload-pack: not our ref 1234', { reason: 'not_our_ref' })), false);
268});
270// ---- a server that lies in the deep pack ----
271// The deep fetch's answer replaced by a pack of `objects` (each { type, data }), framed as upload-pack frames it.
272async function packAnswer(objects) {
273 const { pack } = await buildPack(objects);
274 const parts = [unwrap(pkt('packfile\n'))];
275 for (let i = 0; i < pack.length; i += 65000) parts.push(unwrap(pkt(concat([Uint8Array.of(1), pack.subarray(i, Math.min(i + 65000, pack.length))]))));
276 parts.push(FLUSH);
277 return concat(parts);
279const obj = (bare, type, spec) => ({ type: TYPE[type.toUpperCase()], data: new Uint8Array(gitBuf(bare, ['cat-file', type, spec])) });
280// A tree git's fsck refuses and ply's assertFetched does too: an entry named `.git`.
281const badTree = blob => ({ type: TYPE.TREE, data: concat([new TextEncoder().encode('100644 .git\0'), Buffer.from(blob, 'hex')]) });
283test('a lying deep pack is never used: each lie falls back to the tree:0 walk and the answer is git\'s', async () => {
284 const lies = {
285 // only the commit: the walk finds no tree in the harvest and fetches each level
286 'commit only': bare => [obj(bare, 'commit', 'main')],
287 // no commit: not this walk's commit
288 'no commit': bare => [obj(bare, 'tree', 'main^{tree}'), obj(bare, 'tree', 'main:a')],
289 // another commit and its trees: keyed by their own hashes, the wanted commit is not there
290 'another commit': bare => [obj(bare, 'commit', 'main~1'), obj(bare, 'tree', 'main~1^{tree}')],
291 // the commit and a valid tree that is not its root (a forged root): keyed by its own hash, never read as the root
292 'forged root': bare => [obj(bare, 'commit', 'main'), obj(bare, 'tree', 'main:a/b')],
293 // a malformed extra: the response is not trusted at all (#18), nothing from it is used
294 'malformed extra': bare => [obj(bare, 'commit', 'main'), obj(bare, 'tree', 'main^{tree}'), badTree(git(bare, ['rev-parse', 'main:README.md']).trim())],
295 };
296 for (const [name, lie] of Object.entries(lies)) {
297 let bare = null;
298 const r = await repo({ fault: ctx => (ctx.phase !== 'request' && filterOf(ctx.reqBody)?.startsWith('combine:') ? { type: 'bytes', name, bytes: packAnswer(lie(bare)) } : null) });
299 bare = r.bare;
300 if (name === 'another commit') commitFiles(join(root, `w${r.url.split('/').pop().replace('.git', '')}`), bare, { 'later.txt': 'later\n' }, 'later');
301 try {
302 const quirks = {}; const ex = arrayExporter(); const tracer = new Tracer({ exporter: ex });
303 for (let i = 0; i < 3; i++) for (const p of READS) await checkRead(r, p, { tracer, quirks });
304 for (const p of LISTS) await checkList(r, p, { tracer, quirks });
305 const deep = ex.lines.flatMap(flattenLine).filter(s => s.name === 'git.upload-pack fetch' && String(s.attrs['git.fetch.filter']).startsWith('combine:'));
306 assert.ok(deep.length > 0, `${name}: the deep fetch was asked`);
307 if (name === 'malformed extra') assert.ok(deep.every(s => s.attrs['error.type'] === 'pack_corrupt'), `${name}: the deep fetch failed on the malformed object`);
308 } finally { await r.proxy.close(); }
309 }
310});
Diagnostics6 git calls · 116 ms
CallStatusSizeTime0116 ms
discover200191 B3 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 · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=11990
git.response.cache=HIT
git.response.duration_ms=3
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=3
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=2
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 · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=106
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
fetch2006.2 KiB106 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=6332
git.response.cache=MISS
git.response.duration_ms=106
git.fetch.wants=c874eebed2ed3842774a8772aa43def55b49ef1c
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=6332
git.pkt.payload.max=6305
git.sideband.band1.bytes=6305
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
a5e0fbddbcec332c
Request
89c3b67d…
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