Codebergdnkl

foot

master
ply5 git calls494 ms33 KiB3 cachedprotocol v2
661 lines19 KiBRaw
1#include "key-binding.h"
3#include <stdlib.h>
5#define LOG_MODULE "key-binding"
6#define LOG_ENABLE_DBG 0
7#include "log.h"
9#include "config.h"
10#include "debug.h"
11#include "terminal.h"
12#include "util.h"
13#include "wayland.h"
14#include "xkbcommon-vmod.h"
15#include "xmalloc.h"
17struct vmod_map {
18 const char *name;
19 xkb_mod_mask_t virtual_mask;
20 xkb_mod_mask_t real_mask;
21};
23struct key_set {
24 struct key_binding_set public;
26 const struct config *conf;
27 const struct seat *seat;
28 size_t conf_ref_count;
30 /* Virtual to real modifier mappings */
31 struct vmod_map vmods[8];
32};
33typedef tll(struct key_set) bind_set_list_t;
35struct key_binding_manager {
36 struct key_set *last_used_set;
37 bind_set_list_t binding_sets;
38};
40static void load_keymap(struct key_set *set);
41static void unload_keymap(struct key_set *set);
43struct key_binding_manager *
44key_binding_manager_new(void)
46 struct key_binding_manager *mgr = xcalloc(1, sizeof(*mgr));
47 return mgr;
50void
51key_binding_manager_destroy(struct key_binding_manager *mgr)
53 xassert(tll_length(mgr->binding_sets) == 0);
54 free(mgr);
57static void
58initialize_vmod_mappings(struct key_set *set)
60 if (set->seat == NULL || set->seat->kbd.xkb_keymap == NULL)
61 return;
63 set->vmods[0].name = XKB_VMOD_NAME_ALT;
64 set->vmods[1].name = XKB_VMOD_NAME_HYPER;
65 set->vmods[2].name = XKB_VMOD_NAME_LEVEL3;
66 set->vmods[3].name = XKB_VMOD_NAME_LEVEL5;
67 set->vmods[4].name = XKB_VMOD_NAME_META;
68 set->vmods[5].name = XKB_VMOD_NAME_NUM;
69 set->vmods[6].name = XKB_VMOD_NAME_SCROLL;
70 set->vmods[7].name = XKB_VMOD_NAME_SUPER;
72 struct xkb_state *scratch_state = xkb_state_new(set->seat->kbd.xkb_keymap);
73 xassert(scratch_state != NULL);
75 for (size_t i = 0; i < ALEN(set->vmods); i++) {
76 xkb_mod_index_t virt_idx = xkb_keymap_mod_get_index(
77 set->seat->kbd.xkb_keymap, set->vmods[i].name);
79 if (virt_idx != XKB_MOD_INVALID) {
80 xkb_mod_mask_t vmask = 1 << virt_idx;
81 xkb_state_update_mask(scratch_state, vmask, 0, 0, 0, 0, 0);
82 set->vmods[i].real_mask = xkb_state_serialize_mods(
83 scratch_state, XKB_STATE_MODS_DEPRESSED) & ~vmask;
84 set->vmods[i].virtual_mask = vmask;
86 LOG_DBG("%s: 0x%04x -> 0x%04x",
87 set->vmods[i].name,
88 set->vmods[i].virtual_mask,
89 set->vmods[i].real_mask);
90 } else {
91 set->vmods[i].virtual_mask = 0;
92 set->vmods[i].real_mask = 0;
94 LOG_DBG("%s: virtual modifier not available", set->vmods[i].name);
95 }
96 }
98 xkb_state_unref(scratch_state);
101void
102key_binding_new_for_seat(struct key_binding_manager *mgr,
103 const struct seat *seat)
105#if defined(_DEBUG)
106 tll_foreach(mgr->binding_sets, it)
107 xassert(it->item.seat != seat);
108#endif
110 tll_foreach(seat->wayl->terms, it) {
111 struct key_set set = {
112 .public = {
113 .key = tll_init(),
114 .search = tll_init(),
115 .url = tll_init(),
116 .mouse = tll_init(),
117 },
118 .conf = it->item->conf,
119 .seat = seat,
120 .conf_ref_count = 1,
121 };
123 tll_push_back(mgr->binding_sets, set);
124 initialize_vmod_mappings(&tll_back(mgr->binding_sets));
126 LOG_DBG("new (seat): set=%p, seat=%p, conf=%p, ref-count=1",
127 (void *)&tll_back(mgr->binding_sets),
128 (void *)set.seat, (void *)set.conf);
130 load_keymap(&tll_back(mgr->binding_sets));
131 }
133 LOG_DBG("new (seat): total number of sets: %zu",
134 tll_length(mgr->binding_sets));
137void
138key_binding_new_for_conf(struct key_binding_manager *mgr,
139 const struct wayland *wayl, const struct config *conf)
141 tll_foreach(wayl->seats, it) {
142 struct seat *seat = &it->item;
144 struct key_set *existing =
145 (struct key_set *)key_binding_for(mgr, conf, seat);
147 if (existing != NULL) {
148 existing->conf_ref_count++;
149 continue;
150 }
152 struct key_set set = {
153 .public = {
154 .key = tll_init(),
155 .search = tll_init(),
156 .url = tll_init(),
157 .mouse = tll_init(),
158 },
159 .conf = conf,
160 .seat = seat,
161 .conf_ref_count = 1,
162 };
164 tll_push_back(mgr->binding_sets, set);
165 initialize_vmod_mappings(&tll_back(mgr->binding_sets));
167 load_keymap(&tll_back(mgr->binding_sets));
169 /* Chances are high this set will be requested next */
170 mgr->last_used_set = &tll_back(mgr->binding_sets);
172 LOG_DBG("new (conf): set=%p, seat=%p, conf=%p, ref-count=1",
173 (void *)&tll_back(mgr->binding_sets),
174 (void *)set.seat, (void *)set.conf);
175 }
177 LOG_DBG("new (conf): total number of sets: %zu",
178 tll_length(mgr->binding_sets));
181struct key_binding_set * NOINLINE
182key_binding_for(struct key_binding_manager *mgr, const struct config *conf,
183 const struct seat *seat)
185 struct key_set *last_used = mgr->last_used_set;
186 if (last_used != NULL &&
187 last_used->conf == conf &&
188 last_used->seat == seat)
189 {
190 // LOG_DBG("lookup: last used");
191 return &last_used->public;
192 }
194 tll_foreach(mgr->binding_sets, it) {
195 struct key_set *set = &it->item;
197 if (set->conf != conf)
198 continue;
199 if (set->seat != seat)
200 continue;
202#if 0
203 LOG_DBG("lookup: set=%p, seat=%p, conf=%p, ref-count=%zu",
204 (void *)set, (void *)seat, (void *)conf, set->conf_ref_count);
205#endif
206 mgr->last_used_set = set;
207 return &set->public;
208 }
210 return NULL;
213static void
214key_binding_set_destroy(struct key_binding_manager *mgr,
215 struct key_set *set)
217 unload_keymap(set);
218 if (mgr->last_used_set == set)
219 mgr->last_used_set = NULL;
221 /* Note: caller must remove from binding_sets */
224void
225key_binding_remove_seat(struct key_binding_manager *mgr,
226 const struct seat *seat)
228 tll_foreach(mgr->binding_sets, it) {
229 struct key_set *set = &it->item;
231 if (set->seat != seat)
232 continue;
234 key_binding_set_destroy(mgr, set);
235 tll_remove(mgr->binding_sets, it);
237 LOG_DBG("remove seat: set=%p, seat=%p, total number of sets: %zu",
238 (void *)set, (void *)seat, tll_length(mgr->binding_sets));
239 }
241 LOG_DBG("remove seat: total number of sets: %zu",
242 tll_length(mgr->binding_sets));
245void
246key_binding_unref(struct key_binding_manager *mgr, const struct config *conf)
248 tll_foreach(mgr->binding_sets, it) {
249 struct key_set *set = &it->item;
251 if (set->conf != conf)
252 continue;
254 xassert(set->conf_ref_count > 0);
255 if (--set->conf_ref_count == 0) {
256 LOG_DBG("unref conf: set=%p, seat=%p, conf=%p",
257 (void *)set, (void *)set->seat, (void *)conf);
259 key_binding_set_destroy(mgr, set);
260 tll_remove(mgr->binding_sets, it);
261 }
262 }
264 LOG_DBG("unref conf: total number of sets: %zu",
265 tll_length(mgr->binding_sets));
268static xkb_keycode_list_t
269key_codes_for_xkb_sym(struct xkb_keymap *keymap, xkb_keysym_t sym)
271 xkb_keycode_list_t key_codes = tll_init();
273 /*
274 * Find all key codes that map to this symbol.
275 *
276 * This allows us to match bindings in other layouts
277 * too.
278 */
279 struct xkb_state *state = xkb_state_new(keymap);
281 for (xkb_keycode_t code = xkb_keymap_min_keycode(keymap);
282 code <= xkb_keymap_max_keycode(keymap);
283 code++)
284 {
285 if (xkb_state_key_get_one_sym(state, code) == sym)
286 tll_push_back(key_codes, code);
287 }
289 xkb_state_unref(state);
290 return key_codes;
293static xkb_keysym_t
294maybe_repair_key_combo(const struct seat *seat,
295 xkb_keysym_t sym, xkb_mod_mask_t mods)
297 /*
298 * Detect combos containing a shifted symbol and the corresponding
299 * modifier, and replace the shifted symbol with its unshifted
300 * variant.
301 *
302 * For example, the combo is "Control+Shift+U". In this case,
303 * Shift is the modifier used to "shift" 'u' to 'U', after which
304 * 'Shift' will have been "consumed". Since we filter out consumed
305 * modifiers when matching key combos, this key combo will never
306 * trigger (we will never be able to match the 'Shift' modifier).
307 *
308 * There are two correct variants of the above key combo:
309 * - "Control+U" (upper case 'U')
310 * - "Control+Shift+u" (lower case 'u')
311 *
312 * What we do here is, for each key *code*, check if there are any
313 * (shifted) levels where it produces 'sym'. If there are, check
314 * *which* sets of modifiers are needed to produce it, and compare
315 * with 'mods'.
316 *
317 * If there is at least one common modifier, it means 'sym' is a
318 * "shifted" symbol, with the corresponding shifting modifier
319 * explicitly included in the key combo. I.e. the key combo will
320 * never trigger.
321 *
322 * We then proceed and "repair" the key combo by replacing 'sym'
323 * with the corresponding unshifted symbol.
324 *
325 * To reduce the noise, we ignore all key codes where the shifted
326 * symbol is the same as the unshifted symbol.
327 */
329 for (xkb_keycode_t code = xkb_keymap_min_keycode(seat->kbd.xkb_keymap);
330 code <= xkb_keymap_max_keycode(seat->kbd.xkb_keymap);
331 code++)
332 {
333 xkb_layout_index_t layout_idx =
334 xkb_state_key_get_layout(seat->kbd.xkb_state, code);
336 /* Get all unshifted symbols for this key */
337 const xkb_keysym_t *base_syms = NULL;
338 size_t base_count = xkb_keymap_key_get_syms_by_level(
339 seat->kbd.xkb_keymap, code, layout_idx, 0, &base_syms);
341 if (base_count == 0 || sym == base_syms[0]) {
342 /* No unshifted symbols, or unshifted symbol is same as 'sym' */
343 continue;
344 }
346 /* Name of the unshifted symbol, for logging */
347 char base_name[100];
348 xkb_keysym_get_name(base_syms[0], base_name, sizeof(base_name));
350 /* Iterate all shift levels */
351 for (xkb_level_index_t level_idx = 1;
352 level_idx < xkb_keymap_num_levels_for_key(
353 seat->kbd.xkb_keymap, code, layout_idx);
354 level_idx++) {
356 /* Get all symbols for current shift level */
357 const xkb_keysym_t *shifted_syms = NULL;
358 size_t shifted_count = xkb_keymap_key_get_syms_by_level(
359 seat->kbd.xkb_keymap, code,
360 layout_idx, level_idx, &shifted_syms);
362 for (size_t i = 0; i < shifted_count; i++) {
363 if (shifted_syms[i] != sym)
364 continue;
366 /* Get modifier sets that produces the current shift level */
367 xkb_mod_mask_t mod_masks[16];
368 size_t mod_mask_count = xkb_keymap_key_get_mods_for_level(
369 seat->kbd.xkb_keymap, code, layout_idx, level_idx,
370 mod_masks, ALEN(mod_masks));
372 /* Check if key combo's modifier set intersects */
373 for (size_t j = 0; j < mod_mask_count; j++) {
374 if ((mod_masks[j] & mods) != mod_masks[j])
375 continue;
377 char combo[64] = {0};
379 for (int k = 0; k < sizeof(xkb_mod_mask_t) * 8; k++) {
380 if (!(mods & (1u << k)))
381 continue;
383 const char *mod_name = xkb_keymap_mod_get_name(
384 seat->kbd.xkb_keymap, k);
385 strcat(combo, mod_name);
386 strcat(combo, "+");
387 }
389 size_t len = strlen(combo);
390 xkb_keysym_get_name(
391 sym, &combo[len], sizeof(combo) - len);
393 LOG_WARN(
394 "%s: combo with both explicit modifier and shifted symbol "
395 "(level=%d, mod-mask=0x%08x), "
396 "replacing with %s",
397 combo, level_idx, mod_masks[j], base_name);
399 /* Replace with unshifted symbol */
400 return base_syms[0];
401 }
402 }
403 }
404 }
406 return sym;
409static int
410key_cmp(struct key_binding a, struct key_binding b)
412 xassert(a.type == b.type);
414 /*
415 * Sort bindings such that bindings with the same symbol are
416 * sorted with the binding having the most modifiers comes first.
417 *
418 * This fixes an issue where the "wrong" key binding are triggered
419 * when used with "consumed" modifiers.
420 *
421 * For example: if Control+BackSpace is bound before
422 * Control+Shift+BackSpace, then the latter binding is never
423 * triggered.
424 *
425 * Why? Because Shift is a consumed modifier. This means
426 * Control+BackSpace is "the same" as Control+Shift+BackSpace.
427 *
428 * By sorting bindings with more modifiers first, we work around
429 * the problem. But note that it is *just* a workaround, and I'm
430 * not confident there aren't cases where it doesn't work.
431 *
432 * See https://codeberg.org/dnkl/foot/issues/1280
433 */
435 const int a_mod_count = __builtin_popcount(a.mods);
436 const int b_mod_count = __builtin_popcount(b.mods);
438 switch (a.type) {
439 case KEY_BINDING:
440 if (a.k.sym != b.k.sym)
441 return b.k.sym - a.k.sym;
442 return b_mod_count - a_mod_count;
444 case MOUSE_BINDING: {
445 if (a.m.button != b.m.button)
446 return b.m.button - a.m.button;
447 if (a_mod_count != b_mod_count)
448 return b_mod_count - a_mod_count;
449 return b.m.count - a.m.count;
450 }
451 }
453 BUG("invalid key binding type");
454 return 0;
457static void NOINLINE
458sort_binding_list(key_binding_list_t *list)
460 tll_sort(*list, key_cmp);
463static xkb_mod_mask_t
464mods_to_mask(const struct seat *seat,
465 const struct vmod_map *vmods, size_t vmod_count,
466 const config_modifier_list_t *mods)
468 xkb_mod_mask_t mask = 0;
469 tll_foreach(*mods, it) {
470 const xkb_mod_index_t idx = xkb_keymap_mod_get_index(seat->kbd.xkb_keymap, it->item);
472 if (idx == XKB_MOD_INVALID) {
473 LOG_ERR("%s: invalid modifier name", it->item);
474 continue;
475 }
477 xkb_mod_mask_t mod = 1 << idx;
479 /* Check if this is a virtual modifier, and if so, use the
480 real modifier it maps to instead */
481 for (size_t i = 0; i < vmod_count; i++) {
482 if (vmods[i].virtual_mask == mod) {
483 mask |= vmods[i].real_mask;
484 mod = 0;
486 LOG_DBG("%s: virtual modifier, mapped to 0x%04x",
487 it->item, vmods[i].real_mask);
488 break;
489 }
490 }
492 mask |= mod;
493 }
495 return mask;
498static void NOINLINE
499convert_key_binding(struct key_set *set,
500 const struct config_key_binding *conf_binding,
501 key_binding_list_t *bindings)
503 const struct seat *seat = set->seat;
505 xkb_mod_mask_t mods = mods_to_mask(
506 seat, set->vmods, ALEN(set->vmods), &conf_binding->modifiers);
507 xkb_keysym_t sym = maybe_repair_key_combo(seat, conf_binding->k.sym, mods);
509 struct key_binding binding = {
510 .type = KEY_BINDING,
511 .action = conf_binding->action,
512 .aux = &conf_binding->aux,
513 .mods = mods,
514 .k = {
515 .sym = sym,
516 .key_codes = key_codes_for_xkb_sym(seat->kbd.xkb_keymap, sym),
517 },
518 };
519 tll_push_back(*bindings, binding);
520 sort_binding_list(bindings);
523static void
524convert_key_bindings(struct key_set *set)
526 const struct config *conf = set->conf;
528 for (size_t i = 0; i < conf->bindings.key.count; i++) {
529 const struct config_key_binding *binding = &conf->bindings.key.arr[i];
530 convert_key_binding(set, binding, &set->public.key);
531 }
534static void
535convert_search_bindings(struct key_set *set)
537 const struct config *conf = set->conf;
539 for (size_t i = 0; i < conf->bindings.search.count; i++) {
540 const struct config_key_binding *binding = &conf->bindings.search.arr[i];
541 convert_key_binding(set, binding, &set->public.search);
542 }
545static void
546convert_url_bindings(struct key_set *set)
548 const struct config *conf = set->conf;
550 for (size_t i = 0; i < conf->bindings.url.count; i++) {
551 const struct config_key_binding *binding = &conf->bindings.url.arr[i];
552 convert_key_binding(set, binding, &set->public.url);
553 }
556static void
557convert_mouse_binding(struct key_set *set,
558 const struct config_key_binding *conf_binding)
560 struct key_binding binding = {
561 .type = MOUSE_BINDING,
562 .action = conf_binding->action,
563 .aux = &conf_binding->aux,
564 .mods = mods_to_mask(set->seat, set->vmods, ALEN(set->vmods), &conf_binding->modifiers),
565 .m = {
566 .button = conf_binding->m.button,
567 .count = conf_binding->m.count,
568 },
569 };
570 tll_push_back(set->public.mouse, binding);
571 sort_binding_list(&set->public.mouse);
574static void
575convert_mouse_bindings(struct key_set *set)
577 const struct config *conf = set->conf;
579 for (size_t i = 0; i < conf->bindings.mouse.count; i++) {
580 const struct config_key_binding *binding =
581 &conf->bindings.mouse.arr[i];
582 convert_mouse_binding(set, binding);
583 }
586static void NOINLINE
587load_keymap(struct key_set *set)
589 LOG_DBG("load keymap: set=%p, seat=%p, conf=%p",
590 (void *)set, (void *)set->seat, (void *)set->conf);
592 if (set->seat->kbd.xkb_state == NULL ||
593 set->seat->kbd.xkb_keymap == NULL)
594 {
595 LOG_DBG("no XKB keymap");
596 return;
597 }
599 convert_key_bindings(set);
600 convert_search_bindings(set);
601 convert_url_bindings(set);
602 convert_mouse_bindings(set);
604 set->public.selection_overrides = mods_to_mask(
605 set->seat, set->vmods, ALEN(set->vmods),
606 &set->conf->mouse.selection_override_modifiers);
609void
610key_binding_load_keymap(struct key_binding_manager *mgr,
611 const struct seat *seat)
613 tll_foreach(mgr->binding_sets, it) {
614 struct key_set *set = &it->item;
616 if (set->seat == seat) {
617 initialize_vmod_mappings(set);
618 load_keymap(set);
619 }
620 }
623static void NOINLINE
624key_bindings_destroy(key_binding_list_t *bindings)
626 tll_foreach(*bindings, it) {
627 struct key_binding *bind = &it->item;
628 switch (bind->type) {
629 case KEY_BINDING: tll_free(it->item.k.key_codes); break;
630 case MOUSE_BINDING: break;
631 }
633 tll_remove(*bindings, it);
634 }
637static void NOINLINE
638unload_keymap(struct key_set *set)
640 key_bindings_destroy(&set->public.key);
641 key_bindings_destroy(&set->public.search);
642 key_bindings_destroy(&set->public.url);
643 key_bindings_destroy(&set->public.mouse);
644 set->public.selection_overrides = 0;
647void
648key_binding_unload_keymap(struct key_binding_manager *mgr,
649 const struct seat *seat)
651 tll_foreach(mgr->binding_sets, it) {
652 struct key_set *set = &it->item;
653 if (set->seat != seat)
654 continue;
656 LOG_DBG("unload keymap: set=%p, seat=%p, conf=%p",
657 (void *)set, (void *)seat, (void *)set->conf);
659 unload_keymap(set);
660 }
Diagnostics5 git calls · 494 ms
CallStatusSizeTime0494 ms
discover200178 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=178
git.server.agent=git/2.56.1-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=178
git.pkt.payload.max=35
ls-refs20010 KiB472 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=460
git.response.bytes=10322
git.response.cache=EXPIRED
git.response.duration_ms=472
git.protocol.version=2
git.pkt.frames=108
git.pkt.data=107
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=10322
git.pkt.payload.max=106
git.ls_refs.count=107
git.ls_refs.head=refs/heads/master
fetchcombine:blob:none+tree:2 · deepen 12008.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=3
git.response.bytes=8830
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=combine:blob:none+tree:2
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
git.fetch.haves.count=0
git.fetch.deepen=1
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=8830
git.pkt.payload.max=8730
git.sideband.band1.bytes=8730
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=14
git.pack.bytes=8730
git.fetch.wide.objects=14
git.fetch.wide.extra_bytes=9909
git.fetch.wide.blobs=0
fetchtree:0 · deepen 102009.3 KiB · 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=9489
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=tree:0
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
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=9489
git.pkt.payload.max=9389
git.sideband.band1.bytes=9389
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=9389
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a
git.pack.full=10
Open pack map
fetch2004.6 KiB · hit19 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=19
git.response.bytes=4690
git.response.cache=HIT
git.response.duration_ms=19
git.fetch.wants=a2883ed542dfd7f350964f052db2b0cf0de9d8f7
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=4690
git.pkt.payload.max=4663
git.sideband.band1.bytes=4663
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://codeberg.org/dnkl/foot
Ref
refs/heads/master
Commit
c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
cf-ray
a5e28abacc64bd4a
Request
d8ca812b…
Protocol
v2 · sha1
Agent
git/2.56.1-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format