main
1// Adding a member to a closed union fails typecheck at the handler. A used @ts-expect-error that is not an
2// error fails `tsc`, so each incomplete switch below has to stay an error. The complete ones are the pattern:
3// every member, no default, assertNever as the next statement.
4import { assertNever } from '../../src/result.js';
5import type { PackCacheStatus } from '../../src/cachestatus.js';
6import type { PackKind } from '../../src/format.js';
7import type { FetchFeature, KnownObjectFormat, RequiredV2Cap } from '../../src/closed.js';
8import type { NamedHttpStatus } from '../../src/http.js';
10const cacheLabel = (s: PackCacheStatus): string => {
11 switch (s) {
12 case 'HIT': return 'hit';
13 case 'MISS': return 'miss';
14 case 'BUST': return 'bust';
15 case '': return 'none';
16 }
17 return assertNever(s);
18};
19void cacheLabel;
21const cacheMissing = (s: PackCacheStatus): string => {
22 switch (s) {
23 case 'HIT': return 'hit';
24 case 'MISS': return 'miss';
25 case 'BUST': return 'bust';
26 }
27 // @ts-expect-error '' is still possible, so s is not never
28 return assertNever(s);
29};
30void cacheMissing;
32const typeLabel = (t: PackKind): string => {
33 switch (t) {
34 case 'commit': case 'tree': case 'blob': case 'tag': case 'ofs_delta': case 'ref_delta': return t;
35 }
36 return assertNever(t);
37};
38void typeLabel;
40const typeMissing = (t: PackKind): string => {
41 switch (t) {
42 case 'commit': case 'tree': case 'blob': case 'tag': case 'ofs_delta': return t;
43 }
44 // @ts-expect-error 'ref_delta' is still possible, so t is not never
45 return assertNever(t);
46};
47void typeMissing;
49const featureLabel = (f: FetchFeature): string => {
50 switch (f) {
51 case 'filter': case 'shallow': case 'wait-for-done': case 'ref-in-want': case 'sideband-all': return f;
52 }
53 return assertNever(f);
54};
55void featureLabel;
57const featureMissing = (f: FetchFeature): string => {
58 switch (f) {
59 case 'filter': return f;
60 }
61 // @ts-expect-error the other fetch features are still possible, so f is not never
62 return assertNever(f);
63};
64void featureMissing;
66const formatLabel = (f: KnownObjectFormat): string => {
67 switch (f) {
68 case 'sha1': case 'sha256': return f;
69 }
70 return assertNever(f);
71};
72void formatLabel;
74const formatMissing = (f: KnownObjectFormat): string => {
75 switch (f) {
76 case 'sha1': return f;
77 }
78 // @ts-expect-error 'sha256' is still possible, so f is not never
79 return assertNever(f);
80};
81void formatMissing;
83const capLabel = (c: RequiredV2Cap): string => {
84 switch (c) {
85 case 'ls-refs': case 'fetch': return c;
86 }
87 return assertNever(c);
88};
89void capLabel;
91const capMissing = (c: RequiredV2Cap): string => {
92 switch (c) {
93 case 'ls-refs': return c;
94 }
95 // @ts-expect-error 'fetch' is still possible, so c is not never
96 return assertNever(c);
97};
98void capMissing;
100const statusLabel = (s: NamedHttpStatus): string => {
101 switch (s) {
102 case 401: case 403: case 404: case 429: return String(s);
103 }
104 return assertNever(s);
105};
106void statusLabel;
108const statusMissing = (s: NamedHttpStatus): string => {
109 switch (s) {
110 case 401: case 403: case 404: return String(s);
111 }
112 // @ts-expect-error 429 is still possible, so s is not never
113 return assertNever(s);
114};
115void statusMissing;
Diagnostics4 git calls · 31 ms
CallStatusSizeTime031 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=2 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 · hit3 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=145 git.response.cache=HIT git.response.duration_ms=3 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=25 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
fetch200867 B · hit25 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=867 git.response.cache=HIT git.response.duration_ms=25 git.fetch.wants=a2b60cca5058af3c57a508cf0a1799e8e76152f3 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=867 git.pkt.payload.max=846 git.sideband.band1.bytes=845 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
- a5e377c98aef4603
- Request
- d2af4822…
- Protocol
- v2 · sha1
- Agent
- gitty/1.0
- Filter
- advertised
- Fetch
- shallow filter sideband-all
- Capabilities
- agent ls-refs fetch object-format