GitHubivarvong
ply
main
1// Fetch wants, haves and shallows are object ids, parsed once (#156): fetchRequest refuses one that is not, before any
2// request (and negotiate before its first round).
3// git's verdict on the same want line, from git upload-pack itself (protocol v2, stateless, as smart HTTP runs it):
4// upload-pack.c parse_want reads `want <arg>` with get_oid_hex and dies "expected to get oid, not 'want …'" otherwise.
5// get_oid_hex reads either case and only the first 40 characters, so two classes git answers and ply does not take as
6// given: an upper-case id (ply lowercases it: the same object, and git answers ply's line with the same pack) and text
7// after the id (ply refuses it; git would ignore it). Every other non-oid want git refuses, and ply refuses it too.
8// A have (process_haves: "expected SHA1 object, got '…'") and a shallow (process_shallow: "invalid shallow line") are
9// read the same way, with the same two classes git reads past.
10import { test, beforeAll as before, afterAll as after } from 'vitest';
11import assert from 'node:assert/strict';
12import { spawnSync } from 'node:child_process';
13import { join } from 'node:path';
14import { git, tmpRoot, makeBareRepo, commitFiles } from './server.js';
15import { fetchBody, fetchRequest } from '../src/fetch.js';
16import { fetchPack } from '../src/fetchpack.js';
17import { negotiate } from '../src/negotiate.js';
18import { encodeCommit, hashObject } from '../src/objects.js';
19import { mergeTrees } from '../src/merge.js';
20import { createTransport } from '../src/http.js';
21import { Tracer } from '../src/otel.js';
22import { unwrap } from './unwrap.js';
23import { transport as wireTransport, frame, cat, FLUSH } from './space/wire.js';
25let tmp, bare, head;
26before(() => {
27 tmp = tmpRoot();
28 bare = makeBareRepo(tmp.root, 'w', { stock: true });
29 const work = join(tmp.root, 'work');
30 git(tmp.root, ['init', '-q', '-b', 'main', work]);
31 head = commitFiles(work, bare, { a: 'a\n' });
32});
33after(() => tmp.cleanup());
35const te = new TextEncoder();
36// a pkt-line by hand (not ply's writer): the request git reads is the one written here
37const line = s => { const b = te.encode(s); return Buffer.concat([Buffer.from((b.length + 4).toString(16).padStart(4, '0')), b]); };
38const request = (want, extra = []) => Buffer.concat([line('command=fetch\n'), Buffer.from('0001'), line(`want ${want}\n`), ...extra.map(l => line(`${l}\n`)), line('no-progress\n'), line('done\n'), Buffer.from('0000')]);
39// git's refusal of each argument that is not an oid (upload-pack.c parse_want, process_haves, process_shallow)
40const DIES = { want: /expected to get oid, not 'want /, have: /git upload-pack: expected SHA1 object, got '/, shallow: /invalid shallow line: shallow/ };
41// git upload-pack's answer: 'pack' (a packfile section came back) or 'refuse' (it died expecting an oid), and the bytes
42const uploadPack = (body, kind = 'want') => {
43 const r = spawnSync('git', ['upload-pack', '--stateless-rpc', bare], { input: body, env: { ...process.env, GIT_PROTOCOL: 'version=2' } });
44 const out = r.stdout.toString('latin1');
45 if (out.includes('packfile\n')) return { verdict: 'pack', out };
46 assert.match(r.stderr.toString(), DIES[kind], `git's refusal: ${r.stderr}`);
47 return { verdict: 'refuse', out };
48};
49// the pack bytes of an answer: band 1 of every pkt after the packfile header (git may split them differently per run)
50const band1 = out => {
51 const b = Buffer.from(out, 'latin1'), parts = [];
52 for (let p = b.indexOf('packfile\n', 0, 'latin1') + 'packfile\n'.length; p + 4 <= b.length;) {
53 const n = Number.parseInt(b.toString('latin1', p, p + 4), 16);
54 if (n < 4) { p += 4; continue; }
55 if (b[p + 4] === 1) parts.push(b.subarray(p + 5, p + n));
56 p += n;
57 }
58 return Buffer.concat(parts);
59};
60const plyVerdict = want => {
61 const r = fetchRequest({ wants: [want] });
62 if (r.ok) return { verdict: 'ok', want: r.value.wants[0] };
63 assert.equal(r.error.code, 'bad_request');
64 assert.equal(r.error.what, 'want');
65 return { verdict: 'refuse', message: r.error.message };
66};
68test('want: git upload-pack and fetchRequest agree on every class, but the two git reads past', () => {
69 const cells = [
70 // [name, want, git, ply]
71 ['the id', head, 'pack', 'ok'],
72 ['the id in upper case', head.toUpperCase(), 'pack', 'ok'],
73 ['an abbreviation', head.slice(0, 7), 'refuse', 'refuse'],
74 ['one digit short', head.slice(0, 39), 'refuse', 'refuse'],
75 ['a ref name', 'refs/heads/main', 'refuse', 'refuse'],
76 ['HEAD', 'HEAD', 'refuse', 'refuse'],
77 ['empty', '', 'refuse', 'refuse'],
78 ['a non-hex digit', `${head.slice(0, 39)}g`, 'refuse', 'refuse'],
79 // git's get_oid_hex reads 40 characters and stops: what follows is ignored. ply does not send it.
80 ['a 41st character', `${head}x`, 'pack', 'refuse'],
81 ['a second word', `${head} more`, 'pack', 'refuse'],
82 ];
83 const wrong = [];
84 for (const [name, want, gitWant, plyWant] of cells) {
85 const g = uploadPack(request(want)).verdict, p = plyVerdict(want);
86 if (g !== gitWant || p.verdict !== plyWant) wrong.push(`${name}: git ${g}, ply ${p.verdict}`);
87 if (p.verdict === 'refuse' && p.message !== 'invalid want: must be an object id (40 hex digits)') wrong.push(`${name}: ${p.message}`);
88 }
89 assert.deepEqual(wrong, []);
90});
92test('want: an upper-case id is sent lowercase, and git answers the upper-case line with the pack it sends for the id', () => {
93 const upper = head.toUpperCase();
94 assert.equal(unwrap(fetchRequest({ wants: [upper] })).wants[0], head);
95 // ply's body for the upper-case id is its body for the id, byte for byte
96 assert.deepEqual(Buffer.from(unwrap(fetchBody({ wants: [upper] }))), Buffer.from(unwrap(fetchBody({ wants: [head] }))));
97 // and git reads the two lines as one object: the same pack (band 1) in answer to either
98 const pack = band1(uploadPack(request(head)).out);
99 assert.equal(pack.subarray(0, 4).toString(), 'PACK');
100 assert.deepEqual(band1(uploadPack(request(upper)).out), pack);
101});
103test('want: a NUL, CR or LF is the wire refusal it always was; a non-oid want is refused before any request', async () => {
104 for (const w of [`${head}\n`, 'a\rb', 'a\0']) {
105 const r = fetchRequest({ wants: [w] });
106 assert.equal(r.ok, false);
107 assert.equal(r.error.code, 'bad_request');
108 assert.equal(r.error.what, 'want');
109 assert.equal(r.error.message, 'invalid want: must be a string without NUL, CR, or LF');
110 }
111 // the first bad want is the refusal, in order; haves after it are not read
112 const second = fetchRequest({ wants: [head, 'refs/heads/main'], haves: ['x\n'] });
113 assert.equal(second.error.what, 'want');
114 let requests = 0;
115 const t = unwrap(createTransport('http://127.0.0.1:9/r.git', { tracer: new Tracer(), fetchImpl: async () => { requests++; throw new Error('no request expected'); } }));
116 const r = await fetchPack(t, { wants: ['refs/heads/main'] });
117 assert.equal(r.ok, false);
118 assert.equal(r.error.code, 'bad_request');
119 assert.equal(r.error.what, 'want');
120 assert.equal(requests, 0);
121});
123// [name, value, git, ply] for any oid argument: the classes of the want table above
124const oidCells = () => [
125 ['the id', head, 'pack', 'ok'],
126 ['the id in upper case', head.toUpperCase(), 'pack', 'ok'],
127 ['an abbreviation', head.slice(0, 7), 'refuse', 'refuse'],
128 ['one digit short', head.slice(0, 39), 'refuse', 'refuse'],
129 ['a ref name', 'refs/heads/main', 'refuse', 'refuse'],
130 ['HEAD', 'HEAD', 'refuse', 'refuse'],
131 ['empty', '', 'refuse', 'refuse'],
132 ['a non-hex digit', `${head.slice(0, 39)}g`, 'refuse', 'refuse'],
133 ['a 41st character', `${head}x`, 'pack', 'refuse'],
134 ['a second word', `${head} more`, 'pack', 'refuse'],
135];
137for (const [kind, key] of [['have', 'haves'], ['shallow', 'shallows']]) {
138 test(`${kind}: git upload-pack and fetchRequest agree on every class, but the two git reads past`, () => {
139 const wrong = [];
140 for (const [name, value, gitWant, plyWant] of oidCells()) {
141 const g = uploadPack(request(head, [`${kind} ${value}`]), kind).verdict;
142 const r = fetchRequest({ wants: [head], [key]: [value] });
143 const p = r.ok ? 'ok' : 'refuse';
144 if (g !== gitWant || p !== plyWant) wrong.push(`${name}: git ${g}, ply ${p}`);
145 if (!r.ok && (r.error.code !== 'bad_request' || r.error.what !== kind || r.error.message !== `invalid ${kind}: must be an object id (40 hex digits)`)) wrong.push(`${name}: ${r.error.code} ${r.error.what} ${r.error.message}`);
146 // an accepted one is sent as its lowercase id: the line git answered with the same verdict
147 if (r.ok) assert.equal(r.value[key][0], head, name);
148 }
149 assert.deepEqual(wrong, []);
150 });
151}
153test('have, shallow: an upper-case id is sent lowercase; git answers either line with the same pack', () => {
154 for (const kind of ['have', 'shallow']) {
155 const key = `${kind}s`;
156 assert.deepEqual(Buffer.from(unwrap(fetchBody({ wants: [head], [key]: [head.toUpperCase()] }))), Buffer.from(unwrap(fetchBody({ wants: [head], [key]: [head] }))), kind);
157 assert.deepEqual(band1(uploadPack(request(head, [`${kind} ${head.toUpperCase()}`]), kind).out), band1(uploadPack(request(head, [`${kind} ${head}`]), kind).out), kind);
158 }
159});
161test('have, shallow: a NUL, CR or LF is the wire refusal; wants, then haves, then shallows; nothing is sent', async () => {
162 for (const [kind, key] of [['have', 'haves'], ['shallow', 'shallows']]) {
163 for (const v of [`${head}\n`, 'a\rb', 'a\0']) {
164 const r = fetchRequest({ wants: [head], [key]: [v] });
165 assert.deepEqual([r.ok, r.error.code, r.error.what, r.error.message], [false, 'bad_request', kind, `invalid ${kind}: must be a string without NUL, CR, or LF`]);
166 }
167 }
168 assert.equal(fetchRequest({ wants: ['x'], haves: ['y'], shallows: ['z'] }).error.what, 'want');
169 assert.equal(fetchRequest({ wants: [head], haves: ['y'], shallows: ['z'] }).error.what, 'have');
170 assert.equal(fetchRequest({ wants: [head], haves: [head], shallows: ['z'] }).error.what, 'shallow');
171 let requests = 0;
172 const t = unwrap(createTransport('http://127.0.0.1:9/r.git', { tracer: new Tracer(), fetchImpl: async () => { requests++; throw new Error('no request expected'); } }));
173 for (const opts of [{ haves: ['refs/heads/main'] }, { shallows: [head.slice(0, 7)] }]) {
174 const r = await fetchPack(t, { wants: [head], ...opts });
175 assert.deepEqual([r.ok, r.error.code], [false, 'bad_request']);
176 }
177 // negotiate parses every have before its first round: the bad one in the last batch is refused with nothing sent
178 const n = await negotiate(t, { wants: [head], haves: [...Array.from({ length: 40 }, () => head), 'refs/heads/main'], batch: 16 });
179 assert.deepEqual([n.ok, n.error.code, n.error.what], [false, 'bad_request', 'have']);
180 assert.equal(requests, 0);
181});
183test('negotiate: an acknowledgment that is not an object id is the server\'s protocol error, not a have to send back', async () => {
184 // a v2 answer with an acknowledgments section and no pack: the next round would offer each ACKed id as a have
185 const answer = ack => cat([frame('acknowledgments\n'), frame(`ACK ${ack}\n`), FLUSH]);
186 let sent = 0;
187 const served = ack => wireTransport(() => { sent++; return { bytes: answer(ack) }; });
188 const bad = await negotiate(served('refs/heads/main'), { wants: [head], haves: [head, head], batch: 1 });
189 assert.deepEqual([bad.ok, bad.error.code, bad.error.message], [false, 'protocol', 'negotiate: the server acknowledged "refs/heads/main", not an object id']);
190 assert.equal(sent, 1, 'refused after the round that read it');
191 // an id is kept, and the final request (with done) is sent. This server answers that one with acknowledgments too:
192 // git dies on it ("expected 'packfile', received 'acknowledgments'", test/fetch-lying-server.test.js), so it is the
193 // protocol error here. (This line used to expect ok with no pack: the defect, not the contract.)
194 sent = 0;
195 const good = await negotiate(served(head), { wants: [head], haves: [head], batch: 1, maxRounds: 1 });
196 assert.deepEqual([good.ok, good.error.code, sent], [false, 'protocol', 2]);
197 // The acknowledged id is kept in `common` and sent back as a have in the final request, which carries done. This
198 // server acknowledges every round and hands the final request to git upload-pack itself, so the pack is git's answer
199 // to the bytes ply sent. The expected request lines are the protocol's (gitprotocol-v2 fetch: want, have, done).
200 const bodies = [];
201 const real = wireTransport((kind, _service, body) => {
202 if (kind !== 'post') return undefined;
203 const text = Buffer.from(body).toString('latin1');
204 bodies.push(text);
205 return { bytes: text.includes('done\n') ? Buffer.from(uploadPack(Buffer.from(body)).out, 'latin1') : answer(head) };
206 });
207 const kept = await negotiate(real, { wants: [head], haves: [head], batch: 1, maxRounds: 1 });
208 assert.deepEqual([kept.ok, kept.value.common, bodies.length], [true, [head], 2]);
209 assert.deepEqual([bodies[0].includes(`0032have ${head}\n`), bodies[0].includes('0009done\n')], [true, false], 'the round offers the have, without done');
210 assert.deepEqual([bodies[1].includes(`0032want ${head}\n`), bodies[1].includes(`0032have ${head}\n`), bodies[1].includes('0009done\n')], [true, true, true], 'the final request: the want, the acknowledged id as a have, done');
211 // a long acknowledgment is quoted cut short
212 sent = 0;
213 const long = await negotiate(served('x'.repeat(100)), { wants: [head], haves: [head], batch: 1 });
214 assert.equal(long.error.message, `negotiate: the server acknowledged "${'x'.repeat(60)}", not an object id`);
215 // no haves: no round, only the final request (done; this server's acknowledgments-only answer to it is refused)
216 sent = 0;
217 const none = await negotiate(served(head), { wants: [head] });
218 assert.deepEqual([none.ok, none.error.code, sent], [false, 'protocol', 1]);
219 // git writes an acknowledged id as it writes every id, lowercase: an upper-case one is not an id this client sent
220 sent = 0;
221 const upper = await negotiate(served(head.toUpperCase()), { wants: [head], haves: [head], batch: 1 });
222 assert.deepEqual([upper.ok, upper.error.code, sent], [false, 'protocol', 1]);
223});
225// A commit's tree and parent ids are parsed once at encodeCommit (#156). git's judges on the same header lines: git
226// hash-object -t commit (fsck_commit: badTreeSha1, badParentSha1) refuses every line that is not 40 hex digits, and
227// keeps an upper-case id as given; git commit-tree, the porcelain that writes a commit, writes the id lowercase.
228// encodeCommit refuses what fsck refuses and writes what commit-tree writes.
229test('encodeCommit: tree and parent ids against git hash-object (fsck) and git commit-tree', () => {
230 const who = 'A <a@b.c> 1 +0000';
231 const tree = git(tmp.root, ['hash-object', '-t', 'tree', '--stdin'], { input: '' }).trim();
232 const commitText = (t, parents) => `tree ${t}\n${parents.map(p => `parent ${p}\n`).join('')}author ${who}\ncommitter ${who}\n\nm\n`;
233 const fsck = text => spawnSync('git', ['hash-object', '-t', 'commit', '--stdin'], { input: text, cwd: tmp.root }).status === 0 ? 'ok' : 'refuse';
234 const env = { ...process.env, GIT_AUTHOR_NAME: 'A', GIT_AUTHOR_EMAIL: 'a@b.c', GIT_AUTHOR_DATE: '@1 +0000', GIT_COMMITTER_NAME: 'A', GIT_COMMITTER_EMAIL: 'a@b.c', GIT_COMMITTER_DATE: '@1 +0000' };
235 const commitTree = (t, parents) => spawnSync('git', ['--git-dir', bare, 'commit-tree', t, ...parents.flatMap(p => ['-p', p]), '-m', 'm'], { env }).stdout.toString().trim();
236 const ply = (t, parents) => encodeCommit({ tree: t, parents, author: who, message: 'm\n' });
237 // the tree must exist for commit-tree: write the empty tree into the bare repository
238 git(tmp.root, ['--git-dir', bare, 'hash-object', '-w', '-t', 'tree', '--stdin'], { input: '' });
239 const cells = [
240 // [name, value, fsck, ply]
241 ['the id', tree, 'ok', 'ok'],
242 ['upper case', tree.toUpperCase(), 'ok', 'ok'],
243 ['an abbreviation', tree.slice(0, 7), 'refuse', 'refuse'],
244 ['a ref name', 'refs/heads/main', 'refuse', 'refuse'],
245 ['a non-hex digit', `${tree.slice(0, 39)}g`, 'refuse', 'refuse'],
246 ['a 41st character', `${tree}0`, 'refuse', 'refuse'],
247 ['empty', '', 'refuse', 'refuse'],
248 ];
249 const wrong = [];
250 for (const [name, value, gitSays, plySays] of cells) {
251 for (const [what, text, r] of [['tree', commitText(value, []), ply(value, [])], ['parent', commitText(tree, [value]), ply(tree, [value])]]) {
252 const g = fsck(text), p = r.ok ? 'ok' : 'refuse';
253 if (g !== gitSays || p !== plySays) wrong.push(`${what} ${name}: git ${g}, ply ${p}`);
254 if (!r.ok && (r.error.code !== 'bad_request' || r.error.what !== what || !r.error.message.startsWith(`commit: ${what}: oid must be`))) wrong.push(`${what} ${name}: ${r.error.what} ${r.error.message}`);
255 }
256 }
257 assert.deepEqual(wrong, []);
258 // an accepted id, either case, is written as commit-tree writes it: the same commit, byte for byte (same oid)
259 const parent = commitTree(tree, []);
260 for (const [t, ps] of [[tree, []], [tree.toUpperCase(), []], [tree, [parent.toUpperCase()]]]) {
261 const bytes = unwrap(ply(t, ps));
262 assert.equal(hashObject('commit', bytes), commitTree(t.toLowerCase(), ps.map(p => p.toLowerCase())), `${t} ${ps}`);
263 assert.equal(hashObject('commit', bytes), commitTree(t, ps), 'commit-tree lowercases what it is given');
264 }
265 // the header refusal (a NUL or newline) is still the one a tree or parent line gets first; then the id; then the rest
266 assert.deepEqual([ply(`${tree}\n`, []).error.message, ply(tree, [`${tree}\n`]).error.message], ['tree must not contain NUL or newline', 'parent must not contain NUL or newline']);
267 assert.equal(encodeCommit({ tree: 'x', parents: [], author: 'a\nb' }).error.what, 'tree');
268 assert.equal(encodeCommit({ tree, parents: [], author: 'a\nb' }).error.message, 'author must not contain NUL or newline');
269 // parents left out: a root commit, as commit-tree writes it with no -p
270 assert.equal(hashObject('commit', unwrap(encodeCommit({ tree, author: who, message: 'm\n' }))), parent);
271});
273test('mergeTrees parses its three tree ids at the edge: null is the empty tree, anything else is an id, before any read', async () => {
274 let requests = 0;
275 const t = unwrap(createTransport('http://127.0.0.1:9/r.git', { tracer: new Tracer(), fetchImpl: async () => { requests++; throw new Error('no request expected'); } }));
276 for (const side of ['base', 'ours', 'theirs']) {
277 for (const bad of ['refs/heads/main', head.slice(0, 7), head.toUpperCase(), 7]) {
278 const r = await mergeTrees(t, new Map(), { base: null, ours: null, theirs: null, [side]: bad });
279 assert.deepEqual([r.ok, r.error.code, r.error.what], [false, 'bad_request', 'oid'], `${side} ${bad}`);
280 }
281 }
282 // base first, then ours, then theirs
283 assert.equal((await mergeTrees(t, new Map(), { base: 'x', ours: 'y', theirs: 'z' })).error.got, 'x');
284 assert.equal((await mergeTrees(t, new Map(), { base: null, ours: 'y', theirs: 'z' })).error.got, 'y');
285 // three empty trees merge to nothing with no read: as null, and as the empty tree's id held in the cache (each side is
286 // read by its parsed id; a side read as anything else would be fetched, and this transport refuses every request)
287 const empty = unwrap(await mergeTrees(t, new Map(), { base: null, ours: null, theirs: null }));
288 assert.deepEqual([empty.oid, empty.conflicts], [null, []]);
289 const EMPTY = '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
290 const held = unwrap(await mergeTrees(t, new Map([[EMPTY, new Uint8Array(0)]]), { base: EMPTY, ours: EMPTY, theirs: EMPTY }));
291 assert.deepEqual([held.oid, held.conflicts, held.fetched], [null, [], 0]);
292 assert.equal(requests, 0);
293});
Diagnostics6 git calls · 179 ms
CallStatusSizeTime0179 ms
discover200191 B4 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=4 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 KiB81 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=76 git.response.bytes=11990 git.response.cache=EXPIRED git.response.duration_ms=81 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=10Open 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=5323b9266eea5ded637285d1c5320699f12be76eOpen 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=be7e0453974a5fe832f9065a33bb7e3434c10e9bOpen pack map
fetch2005.8 KiB90 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=90 git.response.bytes=5940 git.response.cache=MISS git.response.duration_ms=90 git.fetch.wants=b81ed092f48d51ab26c375ce0c78b404daf4a566 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=5940 git.pkt.payload.max=5913 git.sideband.band1.bytes=5913 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
- a5e2f31b4ede7089
- Request
- d874c71f…
- 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