GitHubivarvong

ply

main
ply6 git calls330 ms29 KiB3 cachedprotocol v2
245 lines19 KiBRaw
1// Rename shapes, decided by git. ply does not detect renames; its promise is to refuse wherever git's rename detection
2// could change the result. The oracle is `git merge-tree --write-tree` (exit status and tree id, git's defaults) on
3// three trees built with git plumbing, and `git cherry-pick` for the pick. The property, for hand shapes and for a
4// seeded generator (moves across directories with identical and edited content, deletes, both-side deletes, a file
5// replaced by a directory and the reverse, directory renames, subtrees identical on both sides):
6//
7// ply ok ⇒ git clean, and the same tree id
8// git conflict ⇒ ply merge_conflict
9//
10// ply conflicting where git is clean is its documented superset; the generated run counts it.
11import { test, beforeAll as before, afterAll as after } from 'vitest';
12import assert from 'node:assert/strict';
13import { join } from 'node:path';
14import { mkdirSync, writeFileSync, rmSync } from 'node:fs';
15import { spawnSync } from 'node:child_process';
16import { tmpRoot, makeBareRepo, startGitServer } from './server.js';
17import { oracleRediff } from './gitversion.js';
18import { mergeBranch } from '../src/merge.js';
19import { cherryPick } from '../src/rebase.js';
20import { Tracer, arrayExporter } from '../src/otel.js';
21import { generateCase } from './fuzz/renames.js';
23const rediff = oracleRediff();
24const ENV = { ...process.env, GIT_AUTHOR_NAME: 'w', GIT_AUTHOR_EMAIL: 'w@x', GIT_COMMITTER_NAME: 'w', GIT_COMMITTER_EMAIL: 'w@x', GIT_AUTHOR_DATE: '1700000000 +0000', GIT_COMMITTER_DATE: '1700000000 +0000', GIT_CONFIG_COUNT: '1', GIT_CONFIG_KEY_0: 'commit.gpgsign', GIT_CONFIG_VALUE_0: 'false' };
25const EMPTY_TREE = '4b825dc642cb6eb9a060e54bf8d69288fbee4904';
26const author = { name: 'm', email: 'm@x', time: 1700000001 };
27const opts = () => ({ tracer: new Tracer({ exporter: arrayExporter() }), rediff });
29let root, cleanup, srv, bare, url, seq = 0;
30const blobs = new Map();
31const sh = (cwd, args, input, env = {}) => spawnSync('git', ['-C', cwd, ...args], { encoding: 'utf8', env: { ...ENV, ...env }, input, maxBuffer: 1 << 26 });
32const must = (cwd, args, input, env) => { const r = sh(cwd, args, input, env); assert.equal(r.status, 0, `git ${args.join(' ')}: ${r.stderr}`); return r.stdout.trim(); };
33before(async () => { ({ root, cleanup } = tmpRoot()); srv = await startGitServer(root); bare = makeBareRepo(root, 'rn'); url = `${srv.url}/rn.git`; });
34after(async () => { await srv?.close(); cleanup?.(); });
36// a tree from { path: content }, with git: hash-object per distinct content, one update-index, write-tree
37const blob = data => { let oid = blobs.get(data); if (oid === undefined) { oid = must(bare, ['hash-object', '-w', '--stdin'], data); blobs.set(data, oid); } return oid; };
38const tree = files => {
39 const paths = Object.keys(files); if (paths.length === 0) return EMPTY_TREE;
40 const env = { GIT_INDEX_FILE: join(root, `idx${seq++}`) };
41 must(bare, ['update-index', '--add', '--index-info'], paths.map(p => `100644 ${blob(files[p])}\t${p}\n`).join(''), env);
42 return must(bare, ['write-tree'], undefined, env);
43};
44const commit = (t, parents, msg) => must(bare, ['commit-tree', t, ...parents.flatMap(p => ['-p', p]), '-m', msg]);
46// One three-way case: git's verdict and ply's, side by side.
47async function both(base, ours, theirs) {
48 const cb = commit(tree(base), [], 'base'); const co = commit(tree(ours), [cb], 'ours'); const ct = commit(tree(theirs), [cb], 'theirs');
49 const id = seq++;
50 must(bare, ['update-ref', `refs/heads/o${id}`, co]); must(bare, ['update-ref', `refs/heads/t${id}`, ct]);
51 const gm = sh(bare, ['-c', `attr.tree=${EMPTY_TREE}`, 'merge-tree', '--write-tree', '--name-only', co, ct]);
52 assert.ok(gm.status === 0 || gm.status === 1, gm.stderr);
53 const git = { clean: gm.status === 0, tree: gm.stdout.split('\n')[0].trim(), info: gm.stdout.split('\n\n').slice(1).join(' ').replace(/\s+/g, ' ').trim() };
54 const r = await mergeBranch(url, { ref: `refs/heads/o${id}`, from: `refs/heads/t${id}`, author }, opts());
55 // a merged ref is left behind; each case has its own pair
56 return { git, r };
58// the property; returns 'equal' | 'both-conflict' | 'superset'
59function judge(name, { git, r }) {
60 if (r.ok) {
61 assert.equal(r.value.outcome, 'merge', `${name}: outcome`);
62 assert.ok(git.clean, `${name}: ply merged clean (tree ${r.value.tree}) where git conflicts: ${git.info}`);
63 assert.equal(r.value.tree, git.tree, `${name}: ply's clean tree differs from git's`);
64 return 'equal';
65 }
66 assert.equal(r.error.code, 'merge_conflict', `${name}: ${r.error.code} ${r.error.message}`);
67 return git.clean ? 'superset' : 'both-conflict';
70const lines = (n, f = i => `line ${i}`) => `${Array.from({ length: n }, (_, i) => f(i)).join('\n')}\n`;
71const C = lines(30);
72const D = lines(30, i => `totally different ${i * 7}`);
73// C with every third line changed: similar enough for git to pair it with C (over 50%), not identical
74const P = lines(30, i => (i % 3 === 0 ? `changed ${i}` : `line ${i}`));
75const K = { keep: 'keep\n' };
77// Each shape: [name, base, ours, theirs, what git says]. `conflict` shapes are the review findings: git names a rename
78// conflict, so ply must refuse. `clean` shapes are their controls: no rename for git to find, so the trees must be equal.
79const SHAPES = [
80 // a file both sides deleted inside a subtree that is the same tree on both sides
81 ['C1 rename out of a subtree identical on both sides vs delete', { ...K, 'x/f': C, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n', w: C }, { ...K, 'x/h': 'h\n' }, 'conflict'],
82 ['C2 rename/rename(1to2) out of an identical subtree', { ...K, 'x/f': C, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n', w1: C }, { ...K, 'x/h': 'h\n', w2: C }, 'conflict'],
83 ['C3 src/util.js -> lib/util.js vs delete', { ...K, 'src/util.js': C, 'src/main.js': 'main\n', 'lib/a.js': 'a\n' }, { ...K, 'src/main.js': 'main\n', 'lib/a.js': 'a\n', 'lib/util.js': C }, { ...K, 'src/main.js': 'main\n', 'lib/a.js': 'a\n' }, 'conflict'],
84 ['C4 a directory both sides collapsed to the same file, its content moved', { ...K, 'x/f': C }, { ...K, x: 'now a file\n', w: C }, { ...K, x: 'now a file\n' }, 'conflict'],
85 // the same with unrelated bytes at w: no rename for git. ply cannot tell without reading blobs, so it refuses, as it
86 // always has for the flat form of this shape (G1 is by path, not by similarity): the documented superset
87 ['ctl C1 unrelated add', { ...K, 'x/f': C, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n', w: D }, { ...K, 'x/h': 'h\n' }, 'clean, refused'],
88 ['ctl C1 nothing added', { ...K, 'x/f': C, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n', keep: 'kept\n' }, 'clean'],
89 // a base file replaced by a directory of the same name
90 ['H1 file -> directory rename vs delete', { ...K, d: C }, { ...K, 'd/x': C }, { ...K }, 'conflict'],
91 ['H2 file -> directory rename/rename(1to2)', { ...K, d: C }, { ...K, 'd/x': C }, { ...K, 'd/y': C }, 'conflict'],
92 // the "rename already applied" stand-down: different renames inside a directory new on both sides
93 ['H3 different renames inside one new directory', { ...K, a: C }, { ...K, 'dir/q': C, 'dir/p': P }, { ...K, 'dir/p': P }, 'conflict'],
94 ['ctl H3 the same rename on both sides (#103)', { ...K, a: C }, { ...K, 'dir/q': C }, { ...K, 'dir/q': C }, 'clean'],
95];
96for (const [name, base, ours, theirs, expected] of SHAPES) {
97 test(`rename shape == git merge-tree: ${name}`, async () => {
98 const got = await both(base, ours, theirs);
99 // the shape is what its name says, by git
100 assert.equal(got.git.clean, expected !== 'conflict', `git: ${got.git.info}`);
101 if (expected === 'conflict') assert.match(got.git.info, /CONFLICT \(rename\//, 'git reports a rename conflict');
102 const verdict = judge(name, got);
103 if (expected === 'clean, refused') assert.equal(verdict, 'superset');
104 if (expected === 'clean') assert.equal(verdict, 'equal', `${name}: git is clean with no rename in play, so must ply be (${got.r.ok ? '' : JSON.stringify(got.r.error.reasons)})`);
105 });
108test('cherry-pick of a delete onto a branch that moved the file: git cherry-pick conflicts (rename/delete), so the pick is not ok', async () => {
109 const name = 'rnpick'; const b = makeBareRepo(root, name); const w = join(root, `w${name}`); mkdirSync(join(w, 'src'), { recursive: true }); mkdirSync(join(w, 'lib'));
110 must(w, ['init', '-q', '-b', 'main']);
111 const ci = msg => { must(w, ['add', '-A']); must(w, ['commit', '-q', '-m', msg]); return must(w, ['rev-parse', 'HEAD']); };
112 writeFileSync(join(w, 'src/util.js'), C); writeFileSync(join(w, 'src/main.js'), 'main\n'); writeFileSync(join(w, 'lib/a.js'), 'a\n'); ci('base');
113 must(w, ['checkout', '-q', '-b', 'topic']); rmSync(join(w, 'src/util.js')); const del = ci('delete util');
114 must(w, ['checkout', '-q', 'main']); must(w, ['mv', 'src/util.js', 'lib/util.js']); ci('move util');
115 must(w, ['push', '-q', b, 'main', 'topic']);
116 const gp = sh(w, ['cherry-pick', del]);
117 assert.equal(gp.status, 1, 'git cherry-pick stops'); assert.match(gp.stdout + gp.stderr, /CONFLICT \(rename\/delete\)/);
118 const p = await cherryPick(`${srv.url}/${name}.git`, { ref: 'refs/heads/main', commit: del, committer: author }, opts());
119 assert.equal(p.ok, false, `git conflicts, ply answered ok (${p.ok ? p.value.outcome : ''})`);
120 assert.equal(p.error.code, 'merge_conflict');
121});
123// Tree reads, counted at the transport: every upload-pack request ply sends is recorded with the ids it wants, and git
124// says which of those are trees. The expected numbers are counted by hand from the shape (each tree named below); a
125// tree wanted twice is a tree fetched twice.
126async function wanted(base, ours, theirs) {
127 const wants = []; const flights = [];
128 const fetch = async (input, init) => {
129 const body = init?.body;
130 const text = typeof body === 'string' ? body : body instanceof Uint8Array ? Buffer.from(body).toString('latin1') : body instanceof ArrayBuffer || ArrayBuffer.isView(body) ? Buffer.from(body.buffer ?? body).toString('latin1') : '';
131 const mine = [...text.matchAll(/want ([0-9a-f]{40})/g)].map(m => m[1]);
132 wants.push(...mine); flights.push([mine, 1]);
133 try { return await globalThis.fetch(input, init); } finally { flights.push([mine, -1]); }
134 };
135 const cb = commit(tree(base), [], 'base'); const co = commit(tree(ours), [cb], 'ours'); const ct = commit(tree(theirs), [cb], 'theirs');
136 const id = seq++;
137 must(bare, ['update-ref', `refs/heads/o${id}`, co]); must(bare, ['update-ref', `refs/heads/t${id}`, ct]);
138 const gm = sh(bare, ['-c', `attr.tree=${EMPTY_TREE}`, 'merge-tree', '--write-tree', '--name-only', co, ct]);
139 const r = await mergeBranch(url, { ref: `refs/heads/o${id}`, from: `refs/heads/t${id}`, author }, { ...opts(), fetchImpl: fetch });
140 const trees = wants.filter(oid => must(bare, ['cat-file', '-t', oid]) === 'tree');
141 // the most tree requests ever open at once: a request is open from the call until its response headers arrive
142 const isTree = new Set(trees); let open = 0; let peak = 0;
143 for (const [oids, d] of flights) if (oids.some(oid => isTree.has(oid))) { open += d; peak = Math.max(peak, open); }
144 return { r, git: { clean: gm.status === 0, tree: gm.stdout.split('\n')[0].trim(), info: gm.stdout }, trees, peak };
146const wide = (n, tag, pre = 'pkg') => Object.fromEntries(Array.from({ length: n }, (_, i) => [`${pre}${i}/f`, `${tag} ${i}\n`]));
147const once = (name, trees) => assert.equal(new Set(trees).size, trees.length, `${name}: a tree was fetched twice (${trees.length} fetches of ${new Set(trees).size} trees)`);
149test('tree reads: 40 directories both sides changed identically, ordinary edits and nothing added or removed, read the three roots and nothing else', async () => {
150 // the roots of base, ours and theirs: 3. Every pkgN is the same tree on ours and theirs, so the merge takes it unread,
151 // and no path was added or removed, so there is no rename to guard: main read these 3 trees
152 const { r, git, trees } = await wanted({ ...K, ...wide(40, 'v1'), a: 'a\n', b: 'b\n' }, { ...K, ...wide(40, 'v2'), a: 'a2\n', b: 'b\n' }, { ...K, ...wide(40, 'v2'), a: 'a\n', b: 'b2\n' });
153 assert.ok(r.ok && git.clean, 'clean on both'); assert.equal(r.value.tree, git.tree);
154 once('40 dirs', trees);
155 assert.equal(trees.length, 3);
156});
158test('tree reads: a both-sides delete inside a shared subtree beside an added file (C1) reads each tree once', async () => {
159 // 3 roots + base's x + the one x ours and theirs share = 5 distinct trees; the shared x is one tree, read once
160 const { r, git, trees } = await wanted({ ...K, 'x/f': C, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n', w: C }, { ...K, 'x/h': 'h\n' });
161 assert.equal(git.clean, false); assert.equal(r.ok, false); assert.equal(r.error.code, 'merge_conflict');
162 once('C1', trees);
163 assert.equal(trees.length, 5);
164});
166test('tree reads: 40 shared directories and a file added on each side read base and the shared copy of each, once', async () => {
167 // an added file could be a rename target, so the shared directories are entered: 3 roots + 40 x (base's, the shared one)
168 const { r, git, trees } = await wanted({ ...K, ...wide(40, 'v1') }, { ...K, ...wide(40, 'v2'), mine: 'o\n' }, { ...K, ...wide(40, 'v2'), yours: 't\n' });
169 assert.ok(r.ok && git.clean, 'clean on both'); assert.equal(r.value.tree, git.tree);
170 once('40 dirs + adds', trees);
171 assert.equal(trees.length, 83);
172});
174// The gate's cost when directories changed identically on both sides (shared) sit beside directories one side alone
175// changed (owner decision 4). G1 needs both a path lost on both sides inside a shared subtree and a path one side alone
176// added or removed, so one "no" settles it; the gate asks the question with fewer directories to read first: the shared
177// subtrees when they are fewer than the one-side-changed directories, the one-side-changed directories otherwise.
178// Every count below is derived by hand from that rule and the shape; main read 3 (the roots) in each of the first three.
179test('tree reads (COST-A): 40 shared directories beside 40 only ours edited read the roots and the 40 one-sided pairs, several at a time', async () => {
180 // 40 shared is not fewer than 40 one-sided, so the one-sided question is asked: 3 roots + base's and ours' copy of
181 // each own<i> (40 x 2) = 83. No add or removal there, so the shared pkg<i> are never read.
182 const { r, git, trees, peak } = await wanted({ ...K, ...wide(40, 'v1'), ...wide(40, 'o1', 'own') }, { ...K, ...wide(40, 'v2'), ...wide(40, 'o2', 'own') }, { ...K, ...wide(40, 'v2'), ...wide(40, 'o1', 'own') });
183 assert.ok(r.ok && git.clean, 'clean on both'); assert.equal(r.value.tree, git.tree);
184 once('COST-A', trees);
185 assert.equal(trees.length, 83);
186 // sibling directories are read 8 at a time, two trees each (base's and ours'): never more than 16 tree requests
187 // open, and more than the 3 a one-after-another descent has (the three roots; then 2 per directory)
188 assert.ok(peak > 3 && peak <= 16, `tree requests open at once: ${peak}`);
189});
191test('tree reads (COST-B): 1 shared directory beside 80 one side edited reads the roots and the shared pair', async () => {
192 // 1 shared is fewer than 80 one-sided, so the shared subtree is entered: 3 roots + base's sh + the one sh ours and
193 // theirs share = 5. Nothing was lost on both sides in it, so no one-sided directory is read.
194 const { r, git, trees } = await wanted({ ...K, 'sh/f': 'v1\n', ...wide(40, 'o1', 'own'), ...wide(40, 't1', 'thr') }, { ...K, 'sh/f': 'v2\n', ...wide(40, 'o2', 'own'), ...wide(40, 't1', 'thr') }, { ...K, 'sh/f': 'v2\n', ...wide(40, 'o1', 'own'), ...wide(40, 't2', 'thr') });
195 assert.ok(r.ok && git.clean, 'clean on both'); assert.equal(r.value.tree, git.tree);
196 once('COST-B', trees);
197 assert.equal(trees.length, 5);
198});
200test('tree reads (COST-C): no shared directory, 80 one side edited: the three roots, as main', async () => {
201 // no directory changed identically on both sides: the gate is not reached; each own<i> / thr<i> is taken from the
202 // side that changed it, unread
203 const { r, git, trees } = await wanted({ ...K, ...wide(40, 'o1', 'own'), ...wide(40, 't1', 'thr') }, { ...K, ...wide(40, 'o2', 'own'), ...wide(40, 't1', 'thr') }, { ...K, ...wide(40, 'o1', 'own'), ...wide(40, 't2', 'thr') });
204 assert.ok(r.ok && git.clean, 'clean on both'); assert.equal(r.value.tree, git.tree);
205 once('COST-C', trees);
206 assert.equal(trees.length, 3);
207});
209test('tree reads: C2 reads 5 trees and C3 reads 7, each once', async () => {
210 // C2: 1 shared (x), no one-sided directory, so the one-sided question is asked and the roots answer it (w1 is new on
211 // ours): nothing read. The shared x is then entered: 3 roots + base's x + the shared x = 5
212 const c2 = await wanted({ ...K, 'x/f': C, 'x/h': 'h\n' }, { ...K, 'x/h': 'h\n', w1: C }, { ...K, 'x/h': 'h\n', w2: C });
213 assert.match(c2.git.info, /CONFLICT \(rename\/rename\)/); assert.equal(c2.r.ok, false); assert.equal(c2.r.error.code, 'merge_conflict');
214 once('C2', c2.trees);
215 assert.equal(c2.trees.length, 5);
216 // C3: 1 shared (src) is not fewer than 1 one-sided (lib), so lib is read first (base's and ours': lib/util.js is new),
217 // then the shared src (base's and the shared one): 3 roots + 2 + 2 = 7
218 const c3 = await wanted({ ...K, 'src/util.js': C, 'src/main.js': 'main\n', 'lib/a.js': 'a\n' }, { ...K, 'src/main.js': 'main\n', 'lib/a.js': 'a\n', 'lib/util.js': C }, { ...K, 'src/main.js': 'main\n', 'lib/a.js': 'a\n' });
219 assert.match(c3.git.info, /CONFLICT \(rename\/delete\)/); assert.equal(c3.r.ok, false); assert.equal(c3.r.error.code, 'merge_conflict');
220 once('C3', c3.trees);
221 assert.equal(c3.trees.length, 7);
222});
224test('a directory both sides replaced with different files (git: add/add) is listed once, with the walk\'s reason', async () => {
225 const got = await both({ ...K, 'x/f': C }, { ...K, x: 'A\n' }, { ...K, x: 'B\n' });
226 assert.equal(got.git.clean, false); assert.match(got.git.info, /CONFLICT \(add\/add\)/);
227 assert.equal(got.r.ok, false);
228 assert.deepEqual(got.r.error.conflicts, ['x']);
229 assert.equal(got.r.error.reasons.x, 'tree');
230});
232// The generated run. RENAME_SEED / RENAME_CASES pick the run; the default is small enough for the suite. This test is
233// the only run of the generator: it is not part of the pinned fuzz run (npm run test:fuzz-pinned).
234test('property: generated rename shapes — ply ok ⇒ git clean with the same tree; git conflict ⇒ ply conflict', async () => {
235 const seed = Number(process.env.RENAME_SEED ?? 7); const cases = Number(process.env.RENAME_CASES ?? 120);
236 const tally = { equal: 0, 'both-conflict': 0, superset: 0 };
237 for (let i = 0; i < cases; i++) {
238 const c = generateCase(seed, i);
239 // oxlint-disable-next-line eslint/no-await-in-loop -- one case at a time against one repository
240 tally[judge(`seed ${seed} case ${i} [${c.ops.join('; ')}]`, await both(c.base, c.ours, c.theirs))]++;
241 }
242 if (process.env.RENAME_TALLY) writeFileSync(process.env.RENAME_TALLY, `${JSON.stringify({ seed, cases, ...tally })}\n`);
243 // the generator reaches both verdicts, or the property proves nothing
244 assert.ok(tally.equal > 0 && tally['both-conflict'] > 0, JSON.stringify(tally));
245}, 600_000);
Diagnostics6 git calls · 330 ms
CallStatusSizeTime0330 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 KiB2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=11990
git.response.cache=UPDATING
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=152
git.pkt.data=151
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=11990
git.pkt.payload.max=122
git.ls_refs.count=151
git.ls_refs.head=refs/heads/main
fetchtree:0 · deepen 102004.2 KiB · 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=320
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 KiB320 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=6341
git.response.cache=MISS
git.response.duration_ms=320
git.fetch.wants=bb897ac32a98cb4c6ad75965dcff213f591f896d
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=6341
git.pkt.payload.max=6314
git.sideband.band1.bytes=6314
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
a5e1e1055864d96e
Request
6aa16ecb…
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