main
1// Streaming pack index (issue #236): read a pack from a stream and return each entry's layout without resolving a delta
2// or keeping an object. indexPack and describePack need the whole pack in memory and resolve every object; this is their
3// counterpart for a pack too large to hold, built on the pull scan (packstream.ts) under its work budget (#240).
4//
5// What it keeps: the scan's constant hold (peakBound('pack-scan'), streambound.ts), plus SCAN_INDEX_ENTRY_BYTES per
6// entry in typed columns, plus OID_BYTES per entry for each oid column in use (whole-object oids when `oids` is on, REF
7// bases once the pack has a REF_DELTA). Columns grow by doubling, never past the header's count, so a header that lies
8// about its count costs only the entries that arrive. A selected object's content (`content`) is held whole until its
9// callback returns; it is capped by maxObjectSize.
10//
11// Verified while scanning: zlib validity and each member's declared size (inflatestream.ts), each OFS base an earlier
12// entry's offset (git index-pack: "delta base offset is out of bound" otherwise), and the trailer when verify is on.
13// Entries are contiguous by construction: the scan reads each one where the previous ended.
14//
15// The resolved type is the type of the whole object a delta chain rests on: a whole object's own; an OFS_DELTA's
16// base's; a REF_DELTA's base's when that base is a whole object in this pack whose oid was computed (oids on). Anything
17// else (a base absent from the pack, a base that is itself a delta, oids off) is unknown, never a guess. `oids` is on by
18// default because REF_DELTA-only packs (what Cloudflare Artifacts sends) resolve nothing without it. A REF chain whose
19// base is another delta stays unknown: linking it needs that delta's oid, which means applying it (#248).
20// Measured: 71 bytes per entry on a REF-only pack (31 + whole oid 20 + REF base 20), plus 4 per whole object while
21// settling.
22import type { PlyError, ErrorOf } from './errors.js';
23import { plyError, argsError } from './errors.js';
24import type { Option, Result } from './result.js';
25import { ok, err, some, none, assertNever } from './result.js';
26import type { Halt, Halted } from './rangesource.js';
27import { UNCANCELLABLE, HALTED, haltOn, drop, aborted } from './rangesource.js';
28import { withDefaults } from './absent.js';
29import type { LimitsInput, CheckedLimits } from './limits.js';
30import { DEFAULT_LIMITS, limitExceeded, parseLimits } from './limits.js';
31import type { Oid } from './sha1.js';
32import { Sha1, fromHex, toOid } from './sha1.js';
33import { encodeBytes } from './bytes.js';
34import type { ObjType } from './format.js';
35import { OBJ_COMMIT, OBJ_TREE, OBJ_BLOB, OBJ_TAG, OBJ_OFS_DELTA, OBJ_REF_DELTA, OID_BYTES } from './format.js';
36import type { PackError, PackPiece, PackScan, ScanBudget } from './packstream.js';
37import { WORK_BUDGET, parsePackInit, parsePackFeed, parsePackClose, parsePackPull } from './packstream.js';
38import { TYPE_NAME } from './objects.js';
40// In-range indexed reads of columns this module sized; noUncheckedIndexedAccess cannot see that.
41/* oxlint-disable typescript/no-unsafe-type-assertion, typescript/non-nullable-type-assertion-style -- in-range indexed reads, see above */
43export type ScanSource = ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
44// A whole object's type: what a delta chain resolves to.
45export type ScannedType = typeof OBJ_COMMIT | typeof OBJ_TREE | typeof OBJ_BLOB | typeof OBJ_TAG;
46// An entry's base as stored: none, an earlier entry (OFS_DELTA, by offset and index), or an id (REF_DELTA). `index` on a
47// REF base is the whole object in this pack with that id, or -1 when there is none (or oids were off).
48export type ScannedBase =
49 | { readonly tag: 'none' }
50 | { readonly tag: 'ofs'; readonly offset: number; readonly index: number }
51 | { readonly tag: 'ref'; readonly oid: Oid; readonly index: number };
52export type ScannedEntry = {
53 readonly index: number;
54 readonly offset: number;
55 readonly headerBytes: number;
56 readonly compressed: number;
57 // the type in the entry header (OFS_DELTA and REF_DELTA included) and its declared inflated size
58 readonly storedType: ObjType;
59 readonly size: number;
60 readonly base: ScannedBase;
61 // The resolved type, or null: unknown, never a guess. Null for a REF_DELTA whose base is outside the pack, a REF_DELTA
62 // whose base is itself a delta (linking it needs that delta's oid, so applying deltas: #248), any REF_DELTA with
63 // oids off, and an OFS_DELTA resting on one of those. A Cloudflare Artifacts pack is REF_DELTA only, so its chains
64 // deeper than one are null here until #248.
65 readonly type: ScannedType | null;
66 // a whole object's id, when oids are on; null for a delta or with oids off
67 readonly oid: Oid | null;
68};
69// What a content callback sees: a whole object, its id once hashed (oids on), and its bytes.
70export type ScannedObject = { readonly index: number; readonly type: ScannedType; readonly size: number; readonly oid: Oid | null };
71export type ScanContent = {
72 readonly select: (head: { readonly index: number; readonly type: ScannedType; readonly size: number }) => boolean;
73 readonly take: (object: ScannedObject, data: Uint8Array) => void | Promise<void>;
74};
75export type ScanIndexOpts = {
76 readonly limits: LimitsInput;
77 readonly verify: boolean;
78 readonly budget: ScanBudget;
79 readonly oids: boolean;
80 readonly content: ScanContent | null;
81 // aborts the scan: every await on `source` (and on content.take) is raced against it, so the call settles `aborted` at
82 // once even when the source never answers (it is asked to cancel, not waited for). Default: never aborts.
83 readonly signal: AbortSignal;
84};
85// A fresh record per call: withDefaults fills it in place.
86const defaultOpts = (): ScanIndexOpts => ({ limits: DEFAULT_LIMITS, verify: true, budget: WORK_BUDGET, oids: true, content: null, signal: UNCANCELLABLE });
88// Typed columns, one slot per entry. `type` is 0 for unknown; `baseIndex` is -1 for none or not found. `oids` holds
89// entry i's whole-object id at i * 20 (empty with oids off; zeros for a delta); `refs` entry i's REF base id at i * 20
90// (empty when the pack has no REF_DELTA; zeros for any other entry).
91export type ScanColumns = {
92 readonly offset: Float64Array;
93 readonly headerBytes: Uint8Array;
94 readonly compressed: Float64Array;
95 readonly size: Float64Array;
96 readonly storedType: Uint8Array;
97 readonly type: Uint8Array;
98 readonly baseIndex: Int32Array;
99 readonly oids: Uint8Array;
100 readonly refs: Uint8Array;
101};
102export type ScannedPack = {
103 readonly version: number;
104 readonly count: number;
105 readonly trailer: string;
106 readonly bytes: number;
107 readonly columns: ScanColumns;
108 // the column bytes this index holds, oid columns included
109 readonly heldBytes: number;
110 // the entry at 0 <= index < count, or none
111 readonly entry: (index: number) => Option<ScannedEntry>;
112 readonly entries: () => IterableIterator<ScannedEntry>;
113};
115// offset 8 + headerBytes 1 + compressed 8 + size 8 + storedType 1 + type 1 + baseIndex 4
116export const SCAN_INDEX_ENTRY_BYTES = 31;
117const FIRST_CAPACITY = 1024;
118const UNKNOWN = 0;
119const NO_INDEX = -1;
121type Store = {
122 n: number;
123 cap: number;
124 offset: Float64Array;
125 headerBytes: Uint8Array;
126 compressed: Float64Array;
127 size: Float64Array;
128 storedType: Uint8Array;
129 type: Uint8Array;
130 baseIndex: Int32Array;
131 oids: Uint8Array;
132 refs: Uint8Array;
133};
134const EMPTY = new Uint8Array(0);
136function grown<T extends Float64Array | Uint8Array | Int32Array>(old: T, make: (n: number) => T, cap: number, used: number): T {
137 const next = make(cap);
138 next.set(old.subarray(0, used));
139 return next;
140}
141// Room for one more entry: double, never past the header's count.
142function ensureRoom(s: Store, count: number, oids: boolean): void {
143 if (s.n < s.cap) return;
144 const cap = Math.min(count, Math.max(FIRST_CAPACITY, s.cap * 2));
145 s.offset = grown(s.offset, k => new Float64Array(k), cap, s.n);
146 s.headerBytes = grown(s.headerBytes, k => new Uint8Array(k), cap, s.n);
147 s.compressed = grown(s.compressed, k => new Float64Array(k), cap, s.n);
148 s.size = grown(s.size, k => new Float64Array(k), cap, s.n);
149 s.storedType = grown(s.storedType, k => new Uint8Array(k), cap, s.n);
150 s.type = grown(s.type, k => new Uint8Array(k), cap, s.n);
151 s.baseIndex = grown(s.baseIndex, k => new Int32Array(k), cap, s.n);
152 if (oids) s.oids = grown(s.oids, k => new Uint8Array(k), cap * OID_BYTES, s.n * OID_BYTES);
153 if (s.refs.length > 0) s.refs = grown(s.refs, k => new Uint8Array(k), cap * OID_BYTES, s.n * OID_BYTES);
154 s.cap = cap;
155}
156const isWhole = (t: number): t is ScannedType => t === OBJ_COMMIT || t === OBJ_TREE || t === OBJ_BLOB || t === OBJ_TAG;
158// The earlier entry at `offset`: offsets are strictly increasing, so a binary search over the first `n`.
159function entryAt(s: Store, offset: number): number {
160 let lo = 0;
161 let hi = s.n - 1;
162 while (lo <= hi) {
163 const mid = (lo + hi) >>> 1;
164 const at = s.offset[mid] as number;
165 if (at === offset) return mid;
166 if (at < offset) lo = mid + 1;
167 else hi = mid - 1;
168 }
169 return NO_INDEX;
170}
171function oidCompare(a: Uint8Array, ai: number, b: Uint8Array, bi: number): number {
172 for (let k = 0; k < OID_BYTES; k++) {
173 const d = (a[ai + k] as number) - (b[bi + k] as number);
174 if (d !== 0) return d;
175 }
176 return 0;
177}
178// The whole object whose id is entry i's REF base, among `sorted` (whole-object indices in oid order), or NO_INDEX.
179function findWhole(s: Store, sorted: Int32Array, i: number): number {
180 let lo = 0;
181 let hi = sorted.length - 1;
182 while (lo <= hi) {
183 const mid = (lo + hi) >>> 1;
184 const cand = sorted[mid] as number;
185 const d = oidCompare(s.oids, cand * OID_BYTES, s.refs, i * OID_BYTES);
186 if (d === 0) return cand;
187 if (d < 0) lo = mid + 1;
188 else hi = mid - 1;
189 }
190 return NO_INDEX;
191}
192// After the last entry: each REF base found among the whole objects (oids on), then every type in pack order. An OFS
193// base is earlier than its delta, and a found REF base is a whole object, so one ascending pass settles every chain.
194// The oid -> index map is the whole objects' indices in oid order: an Int32Array, 4 bytes per whole object, held only
195// while settling.
196function settle(s: Store, oids: boolean): void {
197 let wholes = new Int32Array(0);
198 if (oids && s.refs.length > 0) {
199 let k = 0;
200 for (let i = 0; i < s.n; i++) if (isWhole(s.storedType[i] as number)) k += 1;
201 wholes = new Int32Array(k);
202 k = 0;
203 for (let i = 0; i < s.n; i++) if (isWhole(s.storedType[i] as number)) wholes[k++] = i;
204 wholes.sort((x, y) => oidCompare(s.oids, x * OID_BYTES, s.oids, y * OID_BYTES));
205 }
206 // whole objects first: a REF base can come later in the pack than its delta
207 for (let i = 0; i < s.n; i++) {
208 const stored = s.storedType[i] as number;
209 if (isWhole(stored)) s.type[i] = stored;
210 }
211 for (let i = 0; i < s.n; i++) {
212 const stored = s.storedType[i] as number;
213 if (isWhole(stored)) continue;
214 if (stored === OBJ_REF_DELTA) s.baseIndex[i] = findWhole(s, wholes, i);
215 const base = s.baseIndex[i] as number;
216 s.type[i] = base === NO_INDEX ? UNKNOWN : (s.type[base] as number);
217 }
218}
220function view(s: ScanColumns, oids: boolean, i: number): ScannedEntry {
221 const stored = s.storedType[i] as ObjType;
222 const t = s.type[i] as number;
223 const baseIndex = s.baseIndex[i] as number;
224 let base: ScannedBase;
225 if (stored === OBJ_OFS_DELTA) base = { tag: 'ofs', offset: s.offset[baseIndex] as number, index: baseIndex };
226 else if (stored === OBJ_REF_DELTA) base = { tag: 'ref', oid: toOid(s.refs.subarray(i * OID_BYTES, (i + 1) * OID_BYTES)), index: baseIndex };
227 else base = { tag: 'none' };
228 return {
229 index: i, offset: s.offset[i] as number, headerBytes: s.headerBytes[i] as number, compressed: s.compressed[i] as number,
230 storedType: stored, size: s.size[i] as number, base,
231 type: isWhole(t) ? t : null,
232 oid: oids && isWhole(stored) ? toOid(s.oids.subarray(i * OID_BYTES, (i + 1) * OID_BYTES)) : null,
233 };
234}
236// What an index is besides its columns: the pack's header, trailer and length, and the column bytes it holds.
237export type ScannedMeta = { readonly version: number; readonly count: number; readonly trailer: string; readonly bytes: number; readonly heldBytes: number };
238// An index over `columns` (each sized to the entries; oids on when `columns.oids` holds an id per entry). scanPackIndex
239// builds one after a scan; decodeSavedIndex (packsaved.ts, #260) builds one from saved columns.
240export function scannedPackOf(meta: ScannedMeta, columns: ScanColumns): ScannedPack {
241 const n = columns.offset.length;
242 const oids = columns.oids.length === n * OID_BYTES && n > 0;
243 const entry = (i: number): Option<ScannedEntry> => (Number.isInteger(i) && i >= 0 && i < n ? some(view(columns, oids, i)) : none);
244 function* entries(): IterableIterator<ScannedEntry> { for (let i = 0; i < n; i++) yield view(columns, oids, i); }
245 return { ...meta, columns, entry, entries };
246}
248// The source is the caller's stream and may never answer: its reads and its cancel go through halt.race
249// (rangesource.ts), so an aborted scan waits for neither. The source is asked to stop exactly once: by the halt when the
250// scan aborts, by `cancel` when the scan refuses the pack.
251type Pull = { readonly next: () => Promise<Uint8Array | null | Halted>; readonly cancel: () => Promise<void> };
252function puller(source: ScanSource, halt: Halt): Pull {
253 if ('getReader' in source) {
254 const reader = source.getReader();
255 halt.reading(reader);
256 return {
257 next: async () => {
258 const r = await halt.race(reader.read(), drop);
259 if (r === HALTED) return HALTED;
260 return r.done ? null : r.value;
261 },
262 cancel: async () => {
263 if (halt.halted()) return;
264 halt.reading(null);
265 await halt.race(reader.cancel().catch(drop), drop);
266 },
267 };
268 }
269 const it = source[Symbol.asyncIterator]();
270 const stop = async (): Promise<void> => { if (typeof it.return === 'function') await Promise.resolve(it.return()).catch(drop); };
271 halt.reading({ cancel: stop });
272 return {
273 next: async () => {
274 const r = await halt.race(it.next(), drop);
275 if (r === HALTED) return HALTED;
276 return r.done === true ? null : r.value;
277 },
278 cancel: async () => {
279 if (halt.halted()) return;
280 halt.reading(null);
281 await halt.race(stop(), drop);
282 },
283 };
284}
286// One scan's state: the columns, the pack's header and trailer, and the object being read (its hash when oids are on,
287// its bytes when the caller selected it).
288type Scanner = {
289 readonly s: Store;
290 readonly opts: ScanIndexOpts;
291 readonly halt: Halt;
292 readonly maxSelected: number;
293 version: number;
294 count: number;
295 trailer: string;
296 sha: Sha1 | null;
297 data: Uint8Array;
298 at: number;
299 selected: ScannedType | null;
300};
301type ObjectPiece = Extract<PackPiece, { kind: 'object' }>;
302type ScanError = PackError | PlyError;
304// An OFS base must be an earlier entry's offset; a REF base's id goes in the refs column (allocated on the first one).
305function recordBase(s: Store, i: number, p: ObjectPiece): ScanError | null {
306 s.baseIndex[i] = NO_INDEX;
307 switch (p.base.tag) {
308 case 'none': return null;
309 case 'ofs': {
310 const base = entryAt(s, p.base.offset);
311 if (base === NO_INDEX) return plyError('pack_corrupt', `pack: ofs delta base not at object boundary ${p.base.offset}`);
312 s.baseIndex[i] = base;
313 return null;
314 }
315 case 'ref':
316 if (s.refs.length === 0) s.refs = new Uint8Array(s.cap * OID_BYTES);
317 s.refs.set(fromHex(p.base.oid), i * OID_BYTES);
318 return null;
319 }
320 // Stryker disable next-line ConditionalExpression,BlockStatement,CallExpression: unreachable, the compiler's exhaustiveness check
321 return assertNever(p.base);
322}
323// A whole object: start its hash (oids on), and its buffer when the caller selects it.
324function openWhole(sc: Scanner, i: number, type: ScannedType, size: number): ScanError | null {
325 if (sc.opts.oids) {
326 const head = encodeBytes(`${TYPE_NAME[type]} ${size}\0`);
327 if (!head.ok) return head.error;
328 sc.sha = new Sha1().update(head.value);
329 }
330 const content = sc.opts.content;
331 if (content === null || !content.select({ index: i, type, size })) return null;
332 if (size > sc.maxSelected) return limitExceeded('selected object bytes', size, sc.maxSelected);
333 sc.data = new Uint8Array(size);
334 sc.selected = type;
335 return null;
336}
337function onObject(sc: Scanner, p: ObjectPiece): ScanError | null {
338 const s = sc.s;
339 ensureRoom(s, sc.count, sc.opts.oids);
340 const i = s.n;
341 s.offset[i] = p.offset;
342 s.headerBytes[i] = p.headerBytes;
343 s.size[i] = p.size;
344 s.storedType[i] = p.type;
345 sc.sha = null;
346 sc.data = EMPTY;
347 sc.at = 0;
348 sc.selected = null;
349 // the base is searched among the entries before this one
350 const based = recordBase(s, i, p);
351 s.n += 1;
352 if (based !== null) return based;
353 const stored: number = p.type;
354 return isWhole(stored) ? openWhole(sc, i, stored, p.size) : null;
355}
356function onChunk(sc: Scanner, bytes: Uint8Array): void {
357 if (sc.sha !== null) sc.sha.update(bytes);
358 if (sc.selected === null) return;
359 sc.data.set(bytes, sc.at);
360 sc.at += bytes.length;
361}
362async function onObjectEnd(sc: Scanner, i: number, compressed: number): Promise<ScanError | null> {
363 sc.s.compressed[i] = compressed;
364 let oid: Oid | null = null;
365 if (sc.sha !== null) {
366 const digest = sc.sha.digest();
367 sc.s.oids.set(digest, i * OID_BYTES);
368 oid = toOid(digest);
369 }
370 const content = sc.opts.content;
371 if (sc.selected === null || content === null) return null;
372 const object: ScannedObject = { index: i, type: sc.selected, size: sc.data.length, oid };
373 const data = sc.data;
374 sc.data = EMPTY;
375 sc.selected = null;
376 // the caller's sink is its storage too
377 const taken = await sc.halt.race(Promise.resolve(content.take(object, data)), drop);
378 return taken === HALTED ? aborted('pack scan') : null;
379}
381function finish(sc: Scanner, bytes: number): ScannedPack {
382 const s = sc.s;
383 const n = s.n;
384 const columns: ScanColumns = {
385 offset: s.offset.subarray(0, n), headerBytes: s.headerBytes.subarray(0, n), compressed: s.compressed.subarray(0, n),
386 size: s.size.subarray(0, n), storedType: s.storedType.subarray(0, n), type: s.type.subarray(0, n), baseIndex: s.baseIndex.subarray(0, n),
387 oids: s.oids.subarray(0, n * OID_BYTES), refs: s.refs.subarray(0, n * OID_BYTES),
388 };
389 const heldBytes = s.cap * SCAN_INDEX_ENTRY_BYTES + s.oids.length + s.refs.length;
390 return scannedPackOf({ version: sc.version, count: sc.count, trailer: sc.trailer, bytes, heldBytes }, columns);
391}
393// One pulled piece: feed the scan, record an entry, or note the header or trailer. A non-null error is the refusal.
394async function onPiece(sc: Scanner, st: PackScan, pull: Pull, p: PackPiece): Promise<ScanError | null> {
395 switch (p.kind) {
396 case 'need': {
397 const bytes = await pull.next();
398 if (bytes === HALTED) return aborted('pack scan');
399 if (bytes === null) parsePackClose(st);
400 else parsePackFeed(st, bytes);
401 return null;
402 }
403 case 'header':
404 sc.version = p.version;
405 sc.count = p.count;
406 return null;
407 case 'object': return onObject(sc, p);
408 case 'chunk':
409 onChunk(sc, p.bytes);
410 return null;
411 case 'object-end':
412 return onObjectEnd(sc, p.index, p.compressed);
413 case 'trailer':
414 sc.trailer = p.trailer;
415 return null;
416 case 'end': return null;
417 }
418 // Stryker disable next-line ConditionalExpression,BlockStatement,CallExpression: unreachable, the compiler's exhaustiveness check
419 return assertNever(p);
420}
422// Scan `source` and index every entry (see the top of this file). A refusal is a Result and cancels the source; a source
423// that errors rejects with its own error, and so does a content callback that throws.
424// The limits a scan with these options runs under (the cap a saved index's entry count is held to, transferload.ts).
425export function scanLimitsOf(input: Partial<ScanIndexOpts>): Result<CheckedLimits, ErrorOf<'bad_request'>> {
426 return parseLimits(withDefaults<ScanIndexOpts>(input, defaultOpts()).limits);
427}
429export async function scanPackIndex(source: ScanSource, input: Partial<ScanIndexOpts> = {}): Promise<Result<ScannedPack, ScanError>> {
430 const shape = argsError('scanPackIndex', [['source', source, 'object'], ['options', input, 'object']]);
431 if (shape !== null) return shape;
432 const opts = withDefaults(input, defaultOpts());
433 const limits = parseLimits(opts.limits);
434 if (!limits.ok) return limits;
435 const opened = parsePackInit({ limits: opts.limits, verify: opts.verify, budget: opts.budget });
436 if (!opened.ok) return opened;
437 const st = opened.value;
438 const halt = haltOn(opts.signal);
439 const pull = puller(source, halt);
440 const s: Store = {
441 n: 0, cap: 0, offset: new Float64Array(0), headerBytes: EMPTY, compressed: new Float64Array(0), size: new Float64Array(0),
442 storedType: EMPTY, type: EMPTY, baseIndex: new Int32Array(0), oids: EMPTY, refs: EMPTY,
443 };
444 const sc: Scanner = { s, opts, halt, maxSelected: limits.value.maxObjectSize, version: 0, count: 0, trailer: '', sha: null, data: EMPTY, at: 0, selected: null };
445 try {
446 for (;;) {
447 const got = parsePackPull(st);
448 if (got.ok && got.value.kind === 'end') {
449 settle(s, opts.oids);
450 return ok(finish(sc, st.total));
451 }
452 // oxlint-disable-next-line no-await-in-loop -- one stream, read in order
453 const refused = got.ok ? await onPiece(sc, st, pull, got.value) : got.error;
454 if (refused !== null) {
455 // oxlint-disable-next-line no-await-in-loop -- the loop ends here
456 await pull.cancel();
457 return err(refused);
458 }
459 }
460 } finally {
461 halt.release();
462 }
463}
Diagnostics4 git calls · 404 ms
CallStatusSizeTime0404 ms
discover200152 B3 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=152 git.server.agent=gitty/1.0 git.server.object_format=sha1 git.server.caps=agent ls-refs fetch object-format git.server.fetch=shallow filter sideband-all git.protocol.version=2 git.pkt.frames=8 git.pkt.data=6 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=152 git.pkt.payload.max=34
ls-refs200145 B · hit2 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=145 git.response.cache=HIT git.response.duration_ms=2 git.protocol.version=2 git.pkt.frames=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=145 git.pkt.payload.max=76 git.ls_refs.count=2 git.ls_refs.head=refs/heads/main
fetchblob:none · deepen 1020038 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=398 git.response.bytes=38434 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=blob:none git.fetch.filter.requested=tree:0 git.fetch.filter.fallback=blob:none git.fetch.filter.learned=false 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=6 git.pkt.data=4 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=38434 git.pkt.payload.max=38339 git.sideband.band1.bytes=38338 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=63 git.pack.bytes=38338 git.pack.ofs_delta=0 git.pack.ref_delta=8 git.pack.chain.max=8 git.pack.trailer=0bc36ab7adf82d3109177f11f1ea93f1ce071f77 git.pack.full=55Open pack map
fetch2006.8 KiB398 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=6994 git.response.cache=MISS git.response.duration_ms=398 git.fetch.wants=2cf75f9297856f79cbeb59bbe95bff402a0ee98c 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=3 git.pkt.data=2 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=6994 git.pkt.payload.max=6973 git.sideband.band1.bytes=6972 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://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/ply.git
- Ref
- refs/heads/main
- Commit
- 19912563f540228593df0c489082e5e2508e21e4
- cf-ray
- a5e193fdca9addf0
- Request
- 04920ead…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format