GitHubivarvong
ply
main
1// The planner (planPackBatches) and the builder (packSubset) agree: every batch a plan holds is a pack the builder
2// writes and stock git accepts on top of exactly the earlier batches. The judge is git, never ply:
3// - the source is a real git pack with deep OFS_DELTA chains (`git repack -adf --depth=50 --window=50` over a file
4// edited in every commit, plus many small files)
5// - for crossBatchRef off and on and several budgets, each planned batch is built by packSubset and fed to
6// `git index-pack --strict --fix-thin` in a repository holding only the batches before it
7// - after the last batch `git fsck --strict` passes and the repository's objects (git cat-file --batch-all-objects)
8// are the source's
9// - a resolved index without ids: the plan fails before anything is pushed, and the builder refuses the same cut
10import { test, beforeAll as before, afterAll as after } from 'vitest';
11import assert from 'node:assert/strict';
12import { mkdirSync, writeFileSync, readFileSync, readdirSync } from 'node:fs';
13import { join } from 'node:path';
14import { randomFillSync } from 'node:crypto';
15import { git, gitBuf, tmpRoot, makeBareRepo } from './server.js';
16import { scanPackIndex } from '../src/packscanindex.js';
17import { resolvePackRange } from '../src/packrangeresolve.js';
18import { rangeFromBytes } from '../src/rangesource.js';
19import { planPackBatches } from '../src/packplan.js';
20import { packSubset } from '../src/packsubset.js';
21import { TYPE } from '../src/objects.js';
22import { unwrap } from './unwrap.js';
24const ident = ['-c', 'user.name=a', '-c', 'user.email=a@x'];
25const BIG = { maxRequestBytes: 1 << 30, maxObjects: 1 << 20, maxObjectBytes: 1 << 30, maxCompressedObjectBytes: 1 << 30, reserveBytes: 0, reserveObjects: 0 };
26const VERSIONS = 24;
27let root, cleanup, work, n = 0;
28const src = {};
29const streamOf = bytes => new ReadableStream({ start(c) { c.enqueue(bytes); c.close(); } });
30const drain = async stream => {
31 const parts = [];
32 const reader = stream.getReader();
33 for (;;) { const r = await reader.read(); if (r.done) break; parts.push(Buffer.from(r.value)); }
34 return Buffer.concat(parts);
35};
36// every object a repository holds, as git lists them: "<oid> <type>" lines, sorted
37const objectsOf = dir => git(dir, ['cat-file', '--batch-all-objects', '--batch-check=%(objectname) %(objecttype)']).trim().split('\n').toSorted();
39before(async () => {
40 ({ root, cleanup } = tmpRoot());
41 work = join(root, 'source');
42 mkdirSync(join(work, 'small'), { recursive: true });
43 git(work, ['init', '-q', '-b', 'main']);
44 for (let i = 0; i < 30; i++) writeFileSync(join(work, 'small', `s${i}.txt`), `small file ${i}\n`);
45 // 20 KB that does not compress; every commit replaces 1 KB of it, so each version is a ~1 KB delta on the one before
46 const chain = new Uint8Array(20_000);
47 randomFillSync(chain);
48 for (let v = 0; v < VERSIONS; v++) {
49 randomFillSync(chain, (v * 733) % 19_000, 1000);
50 writeFileSync(join(work, 'chain.bin'), chain);
51 git(work, ['add', '.']);
52 git(work, [...ident, 'commit', '-q', '-m', `v${v}`]);
53 }
54 git(work, ['repack', '-adf', '--depth=50', '--window=50', '-q']);
55 const dir = join(work, '.git', 'objects', 'pack');
56 const file = readdirSync(dir).find(f => f.endsWith('.pack'));
57 src.bytes = new Uint8Array(readFileSync(join(dir, file)));
58 src.objects = objectsOf(work);
59 src.idx = unwrap(await scanPackIndex(streamOf(src.bytes)));
60 src.resolved = unwrap(await resolvePackRange(src.idx, rangeFromBytes(src.bytes)));
61}, 120_000);
62after(() => cleanup());
64// Each batch of the plan built by packSubset as a transfer builds it, and judged by git on top of the earlier batches.
65async function pushAll(plan, label) {
66 const dst = makeBareRepo(root, `d${n++}`);
67 for (const [k, batch] of plan.batches.entries()) {
68 const built = await packSubset(rangeFromBytes(src.bytes), src.idx, batch.entries, { outsideBase: plan.crossBatchRef ? 'ref' : 'refuse', resolved: src.resolved });
69 assert.ok(built.ok, `${label}: batch ${k}/${plan.batches.length} (${batch.entries.length} entries, refRewrites ${batch.refRewrites}) was planned but not built: ${built.ok ? '' : built.error.message}`);
70 const bytes = await drain(built.value.stream);
71 assert.equal(bytes.length, built.value.length, `${label}: batch ${k} length`);
72 assert.ok(bytes.length <= batch.packBytes, `${label}: batch ${k} is ${bytes.length} bytes, planned at most ${batch.packBytes}`);
73 // throws (non-zero exit) when git refuses the pack
74 gitBuf(dst, ['index-pack', '--strict', '--fix-thin', '--stdin'], bytes);
75 }
76 git(dst, ['fsck', '--strict', '--no-dangling']);
77 return objectsOf(dst);
78}
80test('the fixture: git wrote OFS_DELTA chains deep enough to cut below a delta base', () => {
81 const c = src.idx.columns;
82 const ofsOnDelta = [...src.idx.entries()].filter(e => e.base.tag === 'ofs' && c.storedType[e.base.index] === TYPE.OFS_DELTA);
83 assert.ok(ofsOnDelta.length >= 3, `OFS deltas whose base is a delta: ${ofsOnDelta.length}`);
84 assert.ok(Math.max(...src.resolved.columns.depth) >= 3, 'a chain at least 3 deep');
85});
87test('every planned batch of the whole pack is built and accepted by strict git; the destination ends with the source objects', async () => {
88 let split = 0;
89 for (const crossBatchRef of [false, true]) {
90 for (const maxRequestBytes of [1 << 30, 60_000, 34_000, 27_000]) {
91 const label = `cross ${crossBatchRef}, ${maxRequestBytes} bytes`;
92 const plan = planPackBatches(src.idx, src.resolved, { budget: { ...BIG, maxRequestBytes }, crossBatchRef });
93 // a refusal at plan time is the planner's to make (nothing was pushed); a plan must be buildable
94 if (!plan.ok) { assert.equal(plan.error.code, 'limit_exceeded', `${label}: ${plan.error.message}`); continue; }
95 if (plan.value.batches.some(b => b.refRewrites > 0)) split++;
96 assert.deepEqual(await pushAll(plan.value, label), src.objects, label);
97 }
98 }
99 assert.ok(split >= 2, `budgets that cut a delta family: ${split}`);
100}, 300_000);
102test('blobs only, a few objects per push: every cut of the OFS chain is built and accepted by strict git', async () => {
103 const type = src.resolved.columns.type;
104 const blobs = [...Array(src.idx.count).keys()].filter(i => type[i] === TYPE.BLOB);
105 const want = src.objects.filter(l => l.endsWith(' blob'));
106 for (const maxObjects of [2, 7]) {
107 const label = `blobs, ${maxObjects} per push`;
108 const plan = unwrap(planPackBatches(src.idx, src.resolved, { budget: { ...BIG, maxObjects }, select: blobs, crossBatchRef: true }));
109 assert.ok(plan.batches.some(b => b.refRewrites > 0), `${label}: the chain is cut`);
110 assert.deepEqual(await pushAll(plan, label), want, label);
111 }
112}, 300_000);
114test('a REF_DELTA selected before its delta base is written after it: git, already holding the base, accepts the pack', async () => {
115 // the same objects REF-only (what Cloudflare Artifacts sends): pack-objects without --delta-base-offset
116 const head = git(work, ['rev-parse', 'HEAD']).trim();
117 const bytes = new Uint8Array(gitBuf(work, ['pack-objects', '--revs', '--stdout', '-q'], `${head}\n`));
118 const idx = unwrap(await scanPackIndex(streamOf(bytes)));
119 const resolved = unwrap(await resolvePackRange(idx, rangeFromBytes(bytes)));
120 const base = resolved.columns.base;
121 // C rests on B, B is itself a delta on A; A is left out, so the pack is thin
122 const cIdx = [...Array(idx.count).keys()].find(i => idx.columns.storedType[i] === TYPE.REF_DELTA && base[i] >= 0 && idx.columns.storedType[base[i]] === TYPE.REF_DELTA);
123 assert.ok(cIdx !== undefined, 'a REF delta on a REF delta');
124 const built = unwrap(await packSubset(rangeFromBytes(bytes), idx, [cIdx, base[cIdx]], { resolved }));
125 const out = await drain(built.stream);
126 assert.equal(out.length, built.length);
127 // the receiver already has every object (B included). Stock git refuses the pack when C precedes B: resolving C it
128 // appends B from its own store, then meets B in the pack ("The same object ... appears twice in the pack")
129 const dst = makeBareRepo(root, `o${n++}`);
130 gitBuf(dst, ['index-pack', '--stdin'], Buffer.from(bytes));
131 gitBuf(dst, ['index-pack', '--strict', '--fix-thin', '--stdin'], out);
132});
134test('with `resolved`, a base at entry 0 selected after its delta is moved first (the base-first walk starts at index 0)', async () => {
135 // a one-delta pack whose base is entry 0: an OFS delta on a whole object, the two written base first
136 const base = src.resolved.columns.base;
137 const d = [...Array(src.idx.count).keys()].find(i => src.idx.columns.storedType[i] === TYPE.OFS_DELTA && base[i] >= 0 && src.idx.columns.storedType[base[i]] !== TYPE.OFS_DELTA);
138 assert.ok(d !== undefined, 'an OFS delta on a whole object');
139 const two = unwrap(await packSubset(rangeFromBytes(src.bytes), src.idx, [base[d], d], {}));
140 const bytes = new Uint8Array(await drain(two.stream));
141 const idx = unwrap(await scanPackIndex(streamOf(bytes)));
142 const resolved = unwrap(await resolvePackRange(idx, rangeFromBytes(bytes)));
143 assert.deepEqual([idx.columns.storedType[1], resolved.columns.base[1]], [TYPE.OFS_DELTA, 0], 'entry 1 rests on entry 0');
144 // the delta selected first: base first puts entry 0 before it, so the OFS base is written earlier and nothing is refused
145 const built = unwrap(await packSubset(rangeFromBytes(bytes), idx, [1, 0], { resolved }));
146 const out = await drain(built.stream);
147 assert.equal(out.length, built.length);
148 assert.deepEqual(Buffer.from(out), Buffer.from(bytes), 'the same two entries in the same order as the source pack');
149 gitBuf(makeBareRepo(root, `z${n++}`), ['index-pack', '--strict', '--stdin'], out);
150});
152test('a resolved index that cannot name a cut base fails the plan (nothing is pushed), as the builder refuses it', async () => {
153 const type = src.resolved.columns.type;
154 const blobs = [...Array(src.idx.count).keys()].filter(i => type[i] === TYPE.BLOB);
155 // a resolved index read back without its ids: the builder cannot write a REF_DELTA to a base it cannot name
156 const noIds = { ...src.resolved, oid: () => ({ tag: 'none' }) };
157 const plan = planPackBatches(src.idx, noIds, { budget: { ...BIG, maxObjects: 2 }, select: blobs, crossBatchRef: true });
158 assert.equal(plan.ok, false);
159 assert.equal(plan.error.code, 'bad_request');
160 assert.match(plan.error.message, /OFS_DELTA cut from its base/);
161 // and the builder, asked for such a cut without ids, refuses too (the two share one rule)
162 const base = src.idx.columns.baseIndex;
163 const cut = blobs.find(i => src.idx.columns.storedType[i] === TYPE.OFS_DELTA && src.idx.columns.storedType[base[i]] === TYPE.OFS_DELTA);
164 const built = await packSubset(rangeFromBytes(src.bytes), src.idx, [cut], { outsideBase: 'ref', resolved: noIds });
165 assert.equal(built.ok, false);
166 assert.equal(built.error.code, 'bad_request');
167 // a resolved index of another pack (another entry count) is refused before anything is read
168 const other = await packSubset(rangeFromBytes(src.bytes), src.idx, [0], { resolved: { ...src.resolved, count: src.idx.count + 1 } });
169 assert.equal(other.ok, false);
170 assert.equal(other.error.what, 'pack subset resolved');
171});
173test('an id is asked of `resolved` only for a base outside the batch: none when every base is written beside its delta', async () => {
174 // Expected values by hand: with one batch (or the whole pack selected) every OFS base is written in the same pack,
175 // so no entry is rewritten as a REF_DELTA and no base id is ever needed: 0 lookups. main read an id only there.
176 let asked = 0;
177 const counting = { ...src.resolved, oid: i => { asked++; return src.resolved.oid(i); } };
178 const whole = unwrap(planPackBatches(src.idx, counting, { budget: BIG, crossBatchRef: false }));
179 assert.equal(whole.batches.reduce((a, b) => a + b.refRewrites, 0), 0);
180 assert.equal(asked, 0, 'planPackBatches, families whole');
181 unwrap(planPackBatches(src.idx, counting, { budget: BIG, crossBatchRef: true }));
182 assert.equal(asked, 0, 'planPackBatches, crossBatchRef on, nothing cut');
183 const all = [...Array(src.idx.count).keys()];
184 const built = unwrap(await packSubset(rangeFromBytes(src.bytes), src.idx, all, { outsideBase: 'ref', resolved: counting }));
185 assert.equal(asked, 0, 'packSubset, the whole pack');
186 await built.stream.cancel();
187 // and when the chain is cut the ids are asked for (the lookup is lazy, not gone)
188 const type = src.resolved.columns.type;
189 const blobs = all.filter(i => type[i] === TYPE.BLOB);
190 const cut = unwrap(planPackBatches(src.idx, counting, { budget: { ...BIG, maxObjects: 2 }, select: blobs, crossBatchRef: true }));
191 assert.ok(cut.batches.some(b => b.refRewrites > 0));
192 assert.ok(asked > 0, 'a cut base is looked up');
193});
195test('a resolved index whose oid() is missing, throws, or answers anything but 40 lowercase hex is refused before a byte is read', async () => {
196 const c = src.idx.columns;
197 const type = src.resolved.columns.type;
198 const all = [...Array(src.idx.count).keys()];
199 const blobs = all.filter(i => type[i] === TYPE.BLOB);
200 // an OFS_DELTA on an OFS_DELTA: selected alone, its base is outside the pack and can only be named by `resolved`
201 const cut = blobs.find(i => c.storedType[i] === TYPE.OFS_DELTA && c.storedType[c.baseIndex[i]] === TYPE.OFS_DELTA);
202 assert.ok(cut !== undefined);
203 // the base's id as git names it (verify-pack -v lists "<oid> <type> <size> <size-in-pack> <offset> ..."), not ply
204 const dir = join(work, '.git', 'objects', 'pack');
205 const listed = git(work, ['verify-pack', '-v', join(dir, readdirSync(dir).find(f => f.endsWith('.idx')))]).split('\n').map(l => l.split(/\s+/u));
206 const real = listed.find(f => Number(f[4]) === c.offset[c.baseIndex[cut]])[0];
207 assert.match(real, /^[0-9a-f]{40}$/u);
208 let reads = 0;
209 const bytes = rangeFromBytes(src.bytes);
210 const source = { size: bytes.size, read: (o, l) => { reads++; return bytes.read(o, l); } };
211 const some = value => () => ({ tag: 'some', value });
212 const bad = {
213 'no oid()': undefined,
214 'oid is not a function': real,
215 'oid() throws': () => { throw new Error('boom'); },
216 'oid() answers nothing': () => undefined,
217 'not hex': some('z'.repeat(40)),
218 '39 hex': some(real.slice(1)),
219 '41 hex': some(`${real}0`),
220 'uppercase hex': some('ABCDEF0123'.repeat(4)),
221 'hex with a newline': some(`${real.slice(1)}\n`),
222 'a number': some(7),
223 'bytes': some(new Uint8Array(20)),
224 };
225 for (const [label, oid] of Object.entries(bad)) {
226 const resolved = { ...src.resolved, oid };
227 const plan = planPackBatches(src.idx, resolved, { budget: { ...BIG, maxObjects: 2 }, select: blobs, crossBatchRef: true });
228 assert.equal(plan.ok, false, `${label}: planned`);
229 assert.equal(plan.error.code, 'bad_request', label);
230 const built = await packSubset(source, src.idx, [cut], { outsideBase: 'ref', resolved });
231 assert.equal(built.ok, false, `${label}: built`);
232 assert.equal(built.error.code, 'bad_request', label);
233 assert.equal(built.error.what, 'pack subset base', label);
234 }
235 assert.equal(reads, 0, 'nothing was read for a refused selection');
236 // the control: the same cut with git's own id is planned, built, and a pack strict git accepts on top of the source
237 const built = unwrap(await packSubset(source, src.idx, [cut], { outsideBase: 'ref', resolved: { ...src.resolved, oid: some(real) } }));
238 const out = await drain(built.stream);
239 assert.equal(out.length, built.length);
240 const dst = makeBareRepo(root, `v${n++}`);
241 gitBuf(dst, ['index-pack', '--stdin'], Buffer.from(src.bytes));
242 gitBuf(dst, ['index-pack', '--strict', '--fix-thin', '--stdin'], out);
243});
245test('an id is asked of `resolved` once per rewritten entry, and the answer that was checked is the one the header carries', async () => {
246 const c = src.idx.columns;
247 const type = src.resolved.columns.type;
248 const blobs = [...Array(src.idx.count).keys()].filter(i => type[i] === TYPE.BLOB);
249 const cut = blobs.find(i => c.storedType[i] === TYPE.OFS_DELTA && c.storedType[c.baseIndex[i]] === TYPE.OFS_DELTA);
250 assert.ok(cut !== undefined);
251 // the base's id as git names it (verify-pack -v: "<oid> <type> <size> <size-in-pack> <offset> ..."), not ply
252 const dir = join(work, '.git', 'objects', 'pack');
253 const listed = git(work, ['verify-pack', '-v', join(dir, readdirSync(dir).find(f => f.endsWith('.idx')))]).split('\n').map(l => l.split(/\s+/u));
254 const real = listed.find(f => Number(f[4]) === c.offset[c.baseIndex[cut]])[0];
255 assert.match(real, /^[0-9a-f]{40}$/u);
256 // oid() answers git's id on its first `valid` calls, then `later`: not an id, or the well-formed id of no object
257 for (const [valid, later] of [[1, 'z'.repeat(40)], [2, 'z'.repeat(40)], [1, '1'.repeat(40)]]) {
258 const label = `${valid} valid, then ${later.slice(0, 4)}`;
259 let calls = 0;
260 const resolved = { ...src.resolved, oid: () => ({ tag: 'some', value: ++calls <= valid ? real : later }) };
261 // a Result API: a rejection (a TypeError out of the layout) fails the test here, an errored stream at drain
262 const built = await packSubset(rangeFromBytes(src.bytes), src.idx, [cut], { outsideBase: 'ref', resolved });
263 assert.equal(built.ok, true, `${label}: ${built.ok ? '' : built.error.message}`);
264 const out = await drain(built.value.stream);
265 // by hand: one entry is selected and it is rewritten, so one id is asked for, once
266 assert.equal(calls, 1, `${label}: oid() calls`);
267 assert.equal(out.length, built.value.length, label);
268 // the 20 bytes git names the base by are in the one header written
269 assert.ok(out.includes(Buffer.from(real, 'hex')), `${label}: the header carries git's id`);
270 const dst = makeBareRepo(root, `w${n++}`);
271 gitBuf(dst, ['index-pack', '--stdin'], Buffer.from(src.bytes));
272 gitBuf(dst, ['index-pack', '--strict', '--fix-thin', '--stdin'], out);
273 }
274});
276test('an exception out of resolved.oid() is the cause of a coded refusal from packSubset and planPackBatches, never swallowed', async () => {
277 const c = src.idx.columns;
278 const type = src.resolved.columns.type;
279 const blobs = [...Array(src.idx.count).keys()].filter(i => type[i] === TYPE.BLOB);
280 const budget = { ...BIG, maxObjects: 2 };
281 // an honest plan says which entry is cut from its base (an OFS_DELTA whose stored base is in another batch)
282 const honest = unwrap(planPackBatches(src.idx, src.resolved, { budget, select: blobs, crossBatchRef: true }));
283 const batchOf = new Map(honest.batches.flatMap((b, k) => b.entries.map(i => [i, k])));
284 const cut = blobs.find(i => c.storedType[i] === TYPE.OFS_DELTA && batchOf.get(c.baseIndex[i]) !== batchOf.get(i));
285 assert.ok(cut !== undefined);
286 const cutBase = c.baseIndex[cut];
287 // the expected cause is the test's own object: the refusal must carry this very Error, not a copy or its message
288 const marker = new Error('caller boom');
289 const throwers = {
290 'for every entry': () => { throw marker; },
291 'only for the cut base': i => { if (i === cutBase) throw marker; return src.resolved.oid(i); },
292 };
293 for (const [label, oid] of Object.entries(throwers)) {
294 const resolved = { ...src.resolved, oid };
295 const built = await packSubset(rangeFromBytes(src.bytes), src.idx, [cut], { outsideBase: 'ref', resolved });
296 assert.equal(built.ok, false, `packSubset, oid() throws ${label}`);
297 assert.equal(built.error.code, 'bad_request', label);
298 assert.equal(built.error.what, 'pack subset base', label);
299 assert.equal(built.error.cause, marker, `packSubset, oid() throws ${label}: the cause`);
300 const plan = planPackBatches(src.idx, resolved, { budget, select: blobs, crossBatchRef: true });
301 assert.equal(plan.ok, false, `planPackBatches, oid() throws ${label}`);
302 assert.equal(plan.error.code, 'bad_request', label);
303 assert.equal(plan.error.cause, marker, `planPackBatches, oid() throws ${label}: the cause`);
304 }
305});
307test('an oid() that returns nothing is refused with a message that says so, not one that says it threw', async () => {
308 const c = src.idx.columns;
309 const type = src.resolved.columns.type;
310 const blobs = [...Array(src.idx.count).keys()].filter(i => type[i] === TYPE.BLOB);
311 const budget = { ...BIG, maxObjects: 2 };
312 const honest = unwrap(planPackBatches(src.idx, src.resolved, { budget, select: blobs, crossBatchRef: true }));
313 const batchOf = new Map(honest.batches.flatMap((b, k) => b.entries.map(i => [i, k])));
314 const cut = blobs.find(i => c.storedType[i] === TYPE.OFS_DELTA && batchOf.get(c.baseIndex[i]) !== batchOf.get(i));
315 assert.ok(cut !== undefined);
316 // The expected words are the owner's decision, not the code's: nothing was thrown, so the refusal neither says
317 // 'threw' nor carries a cause (the TypeError ply itself would raise reading `.tag` of nothing is not the caller's).
318 for (const [label, oid] of Object.entries({ 'undefined': () => undefined, 'null': () => null })) {
319 const resolved = { ...src.resolved, oid };
320 const built = await packSubset(rangeFromBytes(src.bytes), src.idx, [cut], { outsideBase: 'ref', resolved });
321 const plan = planPackBatches(src.idx, resolved, { budget, select: blobs, crossBatchRef: true });
322 for (const [api, r] of [['packSubset', built], ['planPackBatches', plan]]) {
323 assert.equal(r.ok, false, `${api}, oid() returns ${label}`);
324 assert.equal(r.error.code, 'bad_request', `${api}, ${label}`);
325 assert.match(r.error.message, /oid\(\) returned nothing/u, `${api}, ${label}`);
326 assert.doesNotMatch(r.error.message, /threw/u, `${api}, ${label}`);
327 assert.equal('cause' in r.error && r.error.cause !== undefined, false, `${api}, ${label}: no cause, nothing was thrown`);
328 }
329 assert.equal(built.error.what, 'pack subset base', label);
330 }
331});
Diagnostics6 git calls · 156 ms
CallStatusSizeTime0156 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 KiB3 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=UPDATING 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=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.9 KiB145 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=145 git.response.bytes=5993 git.response.cache=MISS git.response.duration_ms=145 git.fetch.wants=527ec53b6401443722c2a28f768806c6a25157bc 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=5993 git.pkt.payload.max=5966 git.sideband.band1.bytes=5966 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
- a5e1576fae1b90ce
- Request
- ec4748e6…
- 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