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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
//! What:
//! Consumer-level controls that start the built native executable.
//! Why:
//! Forwarding,
//! self-exclusion,
//! policy decisions and refusals are promises about the
//! program a caller runs as `git`,
//! so they are checked through that program
//! against real Git 2.56.0,
//! never only through library functions.
//!
//! In TS you'd write (pseudocode):
//! ```ts
//! // const wrapped = spawnSync(join(fixture, 'bin/git'), ['--version'], { env });
//! ```
/// Fixtures and bounded process helpers shared by every binary-level control.
/// The hang guard: a thread that ends a wrapped command whose process tree shows no progress or burns too much processor time.
/// The readers of `/proc` the hang guard judges by:
/// stat,
/// io,
/// every task's state,
/// the tree,
/// and one look at it.
/// The pinned identity of a process the hang guard may signal,
/// and the ending of a tree through those identities.
/// The supervisor's judge, readers and monitor, and real commands that loop, deadlock, wait and crawl.
/// The one copy of the built executable per build that fixtures on another filesystem link.
/// The stored copy's name, its lock-free publish, its pruning and the sharing of one wrapper file by fixtures.
/// Where fixtures live and that they go away however their test ends.
/// Exact forwarding of arguments,
/// streams,
/// exit codes,
/// signals and environment.
/// The lines added after Git's answer to `--version`, `-v`, `--help` and `-h`.
/// Wrapper self-exclusion and recursion prevention on PATH.
/// The wrapper never starts itself as Git: launchers, links, copies and other releases behind counting stand-ins.
/// With no real Git after the wrapper on `PATH`, the wrapper falls back to the Git its commit service was set up with
/// when that record passes the `PATH` candidate checks, and otherwise keeps its stop.
/// Configuration loading and the read-only fast path.
/// Wrapper controls,
/// escape hatches and commands Git refuses.
/// The refusal frontier:
/// commands that need work this executable does not do.
/// The pre-forward built-in policies and the fixed transforms.
/// Taking one side of a conflicted file during a merge, rebase, cherry-pick or revert: saved first, conflicted paths only.
/// Every command form that can discard uncommitted state: rejected, allowed in a clean linked worktree, or hatched.
/// The hints of blocks outside the discard guard reach the caller beside an unchanged message.
/// `markdown/autofix` with the linter built from this repository,
/// a missing one and a failing one.
/// `pathBytes` and `changedPathBytes` for a file whose name is not UTF-8.
/// The `git cli-git` management namespace.
/// `git cli-git migrate-to-subvolume` and the doctor's filesystem section through the executable.
/// `git cli-git convert-worktree-to-subvolume` started the way a person starts it, with no forward-target variable.
/// No external hook runs, and configured hooks are reported.
/// The dependent-version policy on direct check and fix.
/// A true merge in a checkout whose index holds another session's staged work: equal to native Git's merge on a
/// clean copy, nothing of the other work disturbed, refusals that change nothing, and recovery after a kill.
/// The word-level second merge pass after a merge, rebase, cherry-pick or revert that Git stops with a conflict.
/// The finish after the second pass: the operation ends like a clean run, and `--no-commit`, `--squash` and `--edit` stop it.
/// The harness that acts on a repository when a running command shows a line on standard error.
/// A `git pull` that merges: completed in isolation like `git merge`, and every other pull left to native Git.
/// A merge that waits for a held `index.lock` and lands on a branch that moved underneath it.
/// Real commits through the transaction: landing, policies, replay and conflict.
/// The Git version text a commit records in the user's cache directory, and when it trusts it.
/// Finding `strace`, which the budget, fault and child-bound controls run a wrapped command under.
/// Reads a `strace` trace of a wrapped commit into process starts and sync calls per program, for the budget controls.
/// Ratchet budgets: the process starts and fsync-class calls of a wrapped commit can only go down.
/// Content a parent commit's tree already holds is not scanned again by forbidden-strings.
/// `pathBytes` for a file whose name is not UTF-8 through the commit path.
/// `mono/catalog-specifiers` through real commits and direct checks, and the repository's own configuration.
/// The linked-worktree ignored-state copy: the rules file reaches new worktrees, and an interrupted copy recovers.
/// Worktree commands beside an add whose real Git still runs: none waits, and each new worktree gets exactly its own copy.
/// The copy for every form of `git worktree add` that Git accepts, and none for each form Git rejects.
/// The cheap-worktree ladder: new worktrees are subvolumes, a forwarded removal destroys them, other forms stay Git's.
/// Rung 1 of the cheap-worktree ladder: a snapshot of a clean subvolume worktree equals Git's own checkout.
/// Rung 2 of the cheap-worktree ladder: clones of a clean worktree's tracked files equal Git's own checkout.
/// The line that says why an add took the slow way: the cause, the remedy, `--quiet`, and the journal entry.
/// A main checkout with uncommitted changes is snapshotted and restored to what Git's own checkout makes.
/// The checkout of a new worktree gets Git's parallel checkout only where the person's configuration sets no `checkout.workers`.
/// The environment of the Git children the auto-push and the manual-push probe start.
/// An explicit push that lost a race to another session: the merge is published by a push planned and run inside the same process.
/// The Git LFS upload before a push: every push the executable starts carries it, and a failure stops the push.
/// The parent that owns an LFS push explains a failed upload from Git's own trace, and no wrapper is started for it.
/// The manual-push probe through the whole wrapper: verbosity cannot bypass a policy, and upstream options publish.
/// A push that Git itself refuses (an absent branch to delete, a refspec naming nothing, no such remote) ends as Git ends it.
/// A push the wrapper cannot scope fails with the hint of its cause, not the one hint of its code.
/// The same upload with the real `git-lfs` against an LFS server written inline.
/// Traditional hooks never run through the wrapper, and `git cli-git doctor` explains the Git LFS shims.
/// A configuration cannot make a Git the wrapper started run a hook through an alias, a monitor program or an editor.
/// The notices of a commit that waits: what it waits for, who holds it, the repeat, and the bound.
/// The fault injection and the recovery invariants of the operating conditions in the README.
/// The wrapper run with no `timeout` in front of it, in a process group of its own, for controls that signal or limit it.
/// Signals sent to the wrapper alone and to its process group.
/// Descriptor, process and address-space limits near exhaustion on the wrapper and on the service, and a single processor.
/// Slow storage, a full disk, failing writes and kills at any call, injected with `strace` into the service and the wrapper's flows.
/// Standard streams that are closed, unread or full.
/// Remote trouble met by the push after a commit and by an explicit push.
/// The experiments behind the hang verdict for the post-commit auto-push with a Git LFS upload.
/// The wrapped commit command through the resident service, compared with native Git.
/// A commit whose prepared content was pruned before it landed: prepared again once, then a plain failure.
/// Two commits of one file in one worktree, the second landing behind the first: its captured bytes merged, never re-read.
/// A backup push the service made after a commit returned and the remote refused, shown by the next wrapper command.
/// Merge, pull's merge, cherry-pick, revert and am hand the push to the service, as a commit does; a rebase does not.
/// A fetch after a Git was killed while it held reference locks: removed on a proof, described and kept otherwise.
/// The message and identity options through the service, compared with native Git field by field.
/// Index commits and `commit -a` through the service, compared with native Git including what is left behind.
/// Amends through the service, compared with native Git field by field including what is left behind.
/// The twin harness of the landing controls: native Git in one byte copy, the service in the other, every field compared.
/// Selection command lines (`-i`, `-p`, `--interactive`, a pathspec file) and the dry run, compared with native Git.
/// States that used to be declined (a conclusion, a detached head, a branch not yet born, an unmerged index, nothing to
/// commit, a rewrite, awkward change lists), compared with native Git.
/// A landing while a foreign `git commit` holds the index lock: the wait, the order, and the limit.
/// The timing record of a wrapped commit and the service's log lines,
/// which split a slow commit by phase.
/// A landing that waits for a foreign index lock in one repository, beside a landing in another.
/// The scratch directory of a commit in preparation, removed by the service when the client's connection closes.
/// The ends of the waits on the commit path: a commit withdrawn at its bound never lands, not even after a restart of the service.
/// The client's wait for the commit service: heartbeats, silence, a start the manager reports failed, a late start.
/// Commits real Git builds for the service (an editor, a signature), compared with the transaction's commit.
/// A commit with named paths during a revert, a cherry-pick or a merge, compared with real Git.
/// A commit of named paths while another session's merge is unfinished lands, and the merge is carried forward.
/// Guard: no option of the wrapper's follows the person's `--` in any Git start, and no `--quiet` is added.
/// The route of a commit and the wrapper's own provisioning of socket activation, against a stand-in session bus.
/// A machine with no way to reach or start a service stops a commit plainly; a directory with no repository gets Git's words.
/// The upgrade from the 0.5.4 release, run with that release's own service program.
/// The resident commit service as a real process: kills at each point of a batch, requests sent again, late and older services.
/// A Git step past its class bound is stopped, named with its class, and the repository recovers.
/// What the person's terminal shows of a commit the service landed: warnings, one summary line, the waits.
/// The package-manager repair of a new worktree: pnpm, Cargo and the toolchain launchers work at the new location.