1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! What:
//! The public update of one pushed reference and the limits on how many queries of a push probe run side by side.
//! Why:
//! The probe in `manual_push_probe.rs` and the lifecycle that reads the scopes both need these; they do not use the probe, so
//! they sit in a file of their own and `manual_push_probe.rs` re-exports them.
//!
//! In TS you'd write (pseudocode):
//! ```ts
//! type PushUpdate = { remoteName: string; remoteOid?: string; to: string; ... };
//! const MOST_CONCURRENT_REMOTE_QUERIES = 4;
//! ```
/// What:
/// One confirmed push update, the public fact the policies read.
/// Why:
/// An absent value is `None`, which replaces the incumbent's `ABSENT_GIT_VALUE` sentinel.
///
/// In TS you'd write (pseudocode):
/// ```ts
/// type PushUpdate = { localOid: string | typeof ABSENT_GIT_VALUE; remoteOid: string | typeof ABSENT_GIT_VALUE; remoteName; remoteRef };
/// ```
/// The most per-destination queries that open a connection to a remote and run at once (`git ls-remote` of each destination):
/// the bound `SPEC.md` gives, four. The remote side (how many connections a server tolerates) was not measured, so the value is
/// the one the SPEC already gave; it is the coordinator's pick under the owner's delegation, open to the owner's veto
/// (`doc/planning/cli-git-shipped-limits-audit.md`, "Picked for these follow-ups", concurrent per-update queries, option B).
pub const MOST_CONCURRENT_REMOTE_QUERIES: usize = 4;
/// The most per-update queries of the local repository that run at once (`git cat-file` and `git rev-list` of each update). Measured
/// on 16 branch tips of this repository, medians of three runs in alternating orders, other sessions running: `git ls-tree -r`
/// took 218, 114, 80, 50 and 46 ms at 1, 2, 4, 8 and 16 at once, and `git rev-list` of a whole branch 845, 413, 231, 190 and 194
/// ms, so eight is where the gain stops. The coordinator's pick under the owner's delegation, open to the owner's veto
/// (`doc/planning/cli-git-shipped-limits-audit.md`, "Picked for these follow-ups", concurrent per-update queries, option B).
pub const MOST_CONCURRENT_LOCAL_QUERIES: usize = LOCAL_QUERY_GAIN_STOPS_AT;
/// The number of queries at once at which the measured gain of local queries stopped (see `MOST_CONCURRENT_LOCAL_QUERIES`).
pub const LOCAL_QUERY_GAIN_STOPS_AT: usize = 8;
/// The bytes one query holds at its peak when it lists the whole history of this repository: the largest resident size of
/// `git rev-list --all` in three runs (29,164 KiB, 29,032 KiB and 28,848 KiB, so 29,863,936 bytes) plus the 1,413,721 bytes of
/// its output, which the wrapper reads whole (34,481 commits on 2026-11-03). `git ls-tree -r` of the main tree peaked at 26,080
/// KiB with 2,459,743 bytes of output.
pub const MEASURED_WHOLE_HISTORY_QUERY: u64 = 29_863_936 + 1_413_721;