@feigi/fleet-ctl 3.17.7 → 3.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/compute-board.mjs +19 -9
- package/scripts/compute-board.test.mjs +91 -0
- package/scripts/finisher-died-prose.test.mjs +31 -0
- package/scripts/fleet-tick-prose.test.mjs +1 -0
- package/scripts/fleet-tick.mjs +20 -9
- package/scripts/fleet-tick.test.mjs +12 -1
- package/scripts/inflight.sh +62 -62
- package/scripts/no-undo-audit.sh +52 -53
- package/scripts/worktree-audit.sh +43 -44
- package/skills/run-team/SKILL.md +14 -0
package/scripts/no-undo-audit.sh
CHANGED
|
@@ -20,14 +20,14 @@ set -eu
|
|
|
20
20
|
# byte landed somewhere sed tolerates. `paste -sd, -` truncates its whole
|
|
21
21
|
# output at the byte while still exiting 0.
|
|
22
22
|
#
|
|
23
|
-
# `awk` is NOT immune, and reap.sh's own
|
|
23
|
+
# `awk` is NOT immune, and reap.sh's own fixture measured the earlier
|
|
24
24
|
# claim here false: it is byte-identical only when every rule matches at an
|
|
25
25
|
# ANCHOR before the bad byte, never needing to convert it — a rule that must
|
|
26
26
|
# SCAN PAST the byte to decide dies instead (BWK awk, macOS: rc 2, `towc:
|
|
27
27
|
# multibyte conversion failure`), and under `set -eu` that death aborts the
|
|
28
28
|
# whole script rather than mis-scoring one record. Reachable only from a
|
|
29
29
|
# fetched tree — a Linux- or latin-1-authored commit — since APFS refuses to
|
|
30
|
-
# hold the name locally.
|
|
30
|
+
# hold the name locally.
|
|
31
31
|
#
|
|
32
32
|
# What that cost was measured on the pipeline that used to split merge-tree's
|
|
33
33
|
# output: PIPESTATUS `1 0 0` — its first stage exiting 1 and truncating, the
|
|
@@ -36,17 +36,17 @@ set -eu
|
|
|
36
36
|
# was watching either, so a conflicting path carrying such a byte dropped every
|
|
37
37
|
# path after it and reported `atRisk: []` at exit 0: a FALSE SAFE from the one
|
|
38
38
|
# tool whose whole job is to say whether a rebase would eat a commit. That
|
|
39
|
-
# split is now a single byte-oriented reader whose status nothing discards
|
|
40
|
-
#
|
|
39
|
+
# split is now a single byte-oriented reader whose status nothing discards,
|
|
40
|
+
# so this pin is no longer the only thing standing between that byte
|
|
41
41
|
# and a false safe there. Nor is it anywhere else: the `sed` and `tr` below
|
|
42
42
|
# that render a path or git's own diagnostic to stderr used to take the audit
|
|
43
43
|
# down with them on that byte, at the exit status that means dirty, and since
|
|
44
|
-
#
|
|
44
|
+
# then each renders through a guard (`render`, and the fold in the stash
|
|
45
45
|
# branch) whose failure cannot reach the verdict. What the pin still buys is
|
|
46
46
|
# those renders WORKING: unpinned, BSD sed exits emitting nothing and BSD tr
|
|
47
47
|
# exits truncating, so the operator loses the diagnostic while the payload and
|
|
48
48
|
# the exit status stay correct. That is now the whole cost of removing it here,
|
|
49
|
-
# and
|
|
49
|
+
# and the test suite's invalid-UTF-8 case is what measures it — grep
|
|
50
50
|
# this file for those renders; json.sh's escapers do not rely on this pin,
|
|
51
51
|
# pinning the locale on each call instead.
|
|
52
52
|
#
|
|
@@ -60,22 +60,22 @@ set -eu
|
|
|
60
60
|
# is always `t`. That one site is why this paragraph says "one, unreachable"
|
|
61
61
|
# where the five sibling scripts' copies say "none" — two of theirs now name a
|
|
62
62
|
# `*[!0-9]*` range instead, this one is the POSIX-class exception.
|
|
63
|
-
# locale-pin
|
|
64
|
-
# code drifts from them
|
|
63
|
+
# The locale-pin prose test holds all six inventories as lists and fails if the
|
|
64
|
+
# code drifts from them; this paragraph is why the entry below exists.
|
|
65
65
|
# Non-ASCII paths are untouched either way:
|
|
66
66
|
# every scrub set below is \001-\037 and every byte of a multi-byte UTF-8
|
|
67
67
|
# sequence is >= \200.
|
|
68
68
|
export LC_ALL=C
|
|
69
69
|
|
|
70
70
|
# Below the locale pin, not above it with `set -eu`: `unset` touches no
|
|
71
|
-
# byte-sensitive tool, but locale-pin
|
|
71
|
+
# byte-sensitive tool, but the locale-pin prose test treats ANY line here that
|
|
72
72
|
# is not a comment, a blank, or `set -[eux]+` as work the pin must sit above,
|
|
73
73
|
# and refuses on principle rather than on this line's own behaviour. Same
|
|
74
74
|
# placement, same reason, as release-ticket.sh's copy.
|
|
75
75
|
#
|
|
76
76
|
# The `--show-prefix` gate below is the guard against exactly this class —
|
|
77
77
|
# "can git operate here" is not "is this the tree it answers about" — and the
|
|
78
|
-
# environment walks straight past it. Both halves measured
|
|
78
|
+
# environment walks straight past it. Both halves measured.
|
|
79
79
|
#
|
|
80
80
|
# GIT_WORK_TREE outranks `-C`, so `git -C "$wt" rev-parse --show-prefix`
|
|
81
81
|
# answers about the AMBIENT tree. When that tree is not an ancestor of the
|
|
@@ -100,16 +100,15 @@ NAME=no-undo-audit
|
|
|
100
100
|
# caller-supplied path, and `emit` below is the one place they all route
|
|
101
101
|
# through. Reached by a CALL, not by a second copy of `emit`'s body spelled
|
|
102
102
|
# here, which is what this line used to be: hand-copied the guard was
|
|
103
|
-
# correct and stayed correct, but
|
|
104
|
-
#
|
|
105
|
-
# way (#1684).
|
|
103
|
+
# correct and stayed correct, but adding the SIGPIPE trap then meant editing
|
|
104
|
+
# both copies, and a call is the only form that cannot be missed that way.
|
|
106
105
|
#
|
|
107
106
|
# What `die` needs from that guard is the header's rule below applied to the
|
|
108
107
|
# one write whose statement MUST still reach an exit: `set -e` reads the
|
|
109
108
|
# write's status before `exit` is ever reached, and with fd 2 closed that
|
|
110
109
|
# status is 1 — REFUSED on this script — so every unanswerable question
|
|
111
|
-
# blamed the worktree instead of saying it could not be answered
|
|
112
|
-
# measured: a path that is not a worktree, `2>&-`, exit 1 where the contract
|
|
110
|
+
# blamed the worktree instead of saying it could not be answered
|
|
111
|
+
# (measured: a path that is not a worktree, `2>&-`, exit 1 where the contract
|
|
113
112
|
# says 2).
|
|
114
113
|
#
|
|
115
114
|
# `emit` is defined below, after `render`, and a shell resolves a function
|
|
@@ -127,11 +126,11 @@ die() { emit "$NAME: $1"; exit 2; }
|
|
|
127
126
|
# failed write, and 1 out of here is the dirty-worktree refusal: with fd 2
|
|
128
127
|
# closed, a clean tree came back "commit the worktree before rebasing", from
|
|
129
128
|
# the one tool whose job is to say whether a rebase would eat a commit.
|
|
130
|
-
# Measured before the fix — clean tree, stdout open, `2>&-`: exit 1
|
|
129
|
+
# Measured before the fix — clean tree, stdout open, `2>&-`: exit 1.
|
|
131
130
|
#
|
|
132
131
|
# The guard is centralized, never hand-appended per site: `render` carries
|
|
133
132
|
# it in a function body every caller inherits, and every other write to fd 2
|
|
134
|
-
# — `die`'s own included
|
|
133
|
+
# — `die`'s own included — goes through `emit()` (defined after
|
|
135
134
|
# `render`), which does the same. A future call site cannot add an unguarded
|
|
136
135
|
# `>&2` write without also adding a new function to sidestep it, and there
|
|
137
136
|
# are two guard bodies to keep in step rather than three. `|| :` is the third
|
|
@@ -151,7 +150,7 @@ die() { emit "$NAME: $1"; exit 2; }
|
|
|
151
150
|
# receives it — on the spot, mid-syscall, before the interpreter ever returns
|
|
152
151
|
# to evaluate the `||` that follows. `|| :` cannot catch a kill; it can only
|
|
153
152
|
# catch a status, and a killed process never produces one for this shell to
|
|
154
|
-
# read (
|
|
153
|
+
# read (measured: a reader that exits before the script finishes
|
|
155
154
|
# writing — not merely a closed fd — took the whole process out at 141,
|
|
156
155
|
# outside the script's own 0/1/2 contract).
|
|
157
156
|
#
|
|
@@ -177,7 +176,7 @@ die() { emit "$NAME: $1"; exit 2; }
|
|
|
177
176
|
# Every operator-facing render that pipes a captured value through an external
|
|
178
177
|
# tool goes through here — bar the stash-diagnostic fold below, which folds
|
|
179
178
|
# rather than indents and carries the same guard inline — and the point of it
|
|
180
|
-
# is that a render CANNOT decide the verdict
|
|
179
|
+
# is that a render CANNOT decide the verdict.
|
|
181
180
|
# Written bare — `printf '%s\n' "$v" | sed 's/^/ /' >&2` — the pipeline's
|
|
182
181
|
# status is sed's, `set -eu` takes it, and the script exits with it: on this
|
|
183
182
|
# script exit 1 is the dirty-worktree refusal, so a render fabricated that
|
|
@@ -200,8 +199,8 @@ die() { emit "$NAME: $1"; exit 2; }
|
|
|
200
199
|
# one more command whose status `set -e` reads, and it would abort for the
|
|
201
200
|
# reason this function exists to remove. The second and third pieces used to
|
|
202
201
|
# be spelled out here, a hand copy of `emit`'s own body; now they are a CALL
|
|
203
|
-
# to it
|
|
204
|
-
#
|
|
202
|
+
# to it, for the same reason `die` stopped carrying its own copy
|
|
203
|
+
# — a hand-copied guard is correct only until the next edit to the
|
|
205
204
|
# original forgets to touch both.
|
|
206
205
|
#
|
|
207
206
|
# `$1` lands in sed's REPLACEMENT text, where `&` and `\` are metacharacters.
|
|
@@ -221,9 +220,9 @@ render() { # render <line-prefix> <text> <what-the-text-is>
|
|
|
221
220
|
emit() { ( trap '' PIPE; printf '%s\n' "$1" >&2 ) || :; }
|
|
222
221
|
|
|
223
222
|
|
|
224
|
-
# The escaping helpers
|
|
223
|
+
# The escaping helpers. json.sh's header holds the sourcing contract and
|
|
225
224
|
# the measurements behind it; only what is true of THIS script is repeated here.
|
|
226
|
-
# Below `export LC_ALL=C` deliberately: locale-pin
|
|
225
|
+
# Below `export LC_ALL=C` deliberately: the locale-pin prose test allows only
|
|
227
226
|
# comments, blanks, a shebang or a `set -` line above that pin, and `json_lib=`
|
|
228
227
|
# is none of them.
|
|
229
228
|
#
|
|
@@ -242,7 +241,7 @@ json_lib="$(dirname "$0")/json.sh"
|
|
|
242
241
|
# or a control byte that git's ref rules would reject. The rule list, its
|
|
243
242
|
# ordering and the jarr/jstr split live in json.sh, once, rather than here and
|
|
244
243
|
# in inflight.sh and in release-ticket.sh — five copies of the same rules
|
|
245
|
-
# before the extraction, counting jarr and jarr_rewritten
|
|
244
|
+
# before the extraction, counting jarr and jarr_rewritten.
|
|
246
245
|
#
|
|
247
246
|
# This script is the only caller that reaches the multi-line machinery: `$wt`
|
|
248
247
|
# is the one value here that can carry a newline, which is why json.sh's slurp
|
|
@@ -254,7 +253,7 @@ base=${BASE_REF:-origin/main}
|
|
|
254
253
|
# Only a remote-tracking ref is accepted — the accept-list `case` that
|
|
255
254
|
# release-ticket.sh and reap.sh carry, and the one this script had none of.
|
|
256
255
|
# worktree-audit.sh carries the same accept-list `case` and already applies the
|
|
257
|
-
#
|
|
256
|
+
# shorthand fix: its `base_rev` qualify `case` turns `$base` into
|
|
258
257
|
# `$base_rev`, and both its `rev-parse --verify "$base_rev"` and its
|
|
259
258
|
# `rev-list --count "$base_rev"..HEAD` read `$base_rev`, never the bare
|
|
260
259
|
# shorthand. Its stake is smaller, though: being audit-only,
|
|
@@ -388,7 +387,7 @@ branch_rev="refs/remotes/origin/$branch"
|
|
|
388
387
|
# false-refusal classes `--show-prefix` cannot have, comparing nothing. It is
|
|
389
388
|
# asked further down all the same, against a CANONICAL `$wt`, for the one claim
|
|
390
389
|
# `--show-prefix` cannot make: which working tree git answers for once
|
|
391
|
-
# `core.worktree` has moved it
|
|
390
|
+
# `core.worktree` has moved it. git's
|
|
392
391
|
# `prunable` is no use either: it marks a worktree whose DIRECTORY is gone, and
|
|
393
392
|
# stays silent for one still holding work whose linkage broke (measured).
|
|
394
393
|
prefix=$(git -C "$wt" rev-parse --show-prefix) \
|
|
@@ -402,14 +401,14 @@ prefix=$(git -C "$wt" rev-parse --show-prefix) \
|
|
|
402
401
|
# actually $wt's". A `.git` file rewritten to name a SIBLING worktree's admin
|
|
403
402
|
# dir still resolves its root to $wt (the file's location did not move) while
|
|
404
403
|
# every git command below — `status` included — answers against the sibling's
|
|
405
|
-
# HEAD and index.
|
|
404
|
+
# HEAD and index.
|
|
406
405
|
#
|
|
407
406
|
# So the second claim is asked separately: which git dir answered, and which
|
|
408
407
|
# worktree does THAT dir belong to. Never keyed on the string `--git-dir`
|
|
409
408
|
# returns without `--path-format=absolute`: that is the literal `.git` for a
|
|
410
409
|
# main checkout AND — measured, git 2.50.1 — for a LINKED worktree whose `.git`
|
|
411
410
|
# is a SYMLINK to another worktree's admin dir, so a guard exempting `.git` as
|
|
412
|
-
# "the main worktree, nothing to verify" exempts the
|
|
411
|
+
# "the main worktree, nothing to verify" exempts the sibling spoof spelled as a
|
|
413
412
|
# symlink instead of a `gitdir:` file. Absolute, and compared as paths: the one
|
|
414
413
|
# place in the script that compares paths, because unlike `--show-prefix` there
|
|
415
414
|
# is no rc/emptiness shortcut for "do these two name the same tree".
|
|
@@ -426,7 +425,7 @@ prefix=$(git -C "$wt" rev-parse --show-prefix) \
|
|
|
426
425
|
# one shape but on every main checkout. `$wt_real` stays canonical only for
|
|
427
426
|
# resolving `$wt` (symlinks, relative paths), not Unicode normalization, so
|
|
428
427
|
# both owner compares below compare as directories (`-ef`) for the same
|
|
429
|
-
# NFC/NFD reason as `$top` below (
|
|
428
|
+
# NFC/NFD reason as `$top` below (detailed there); the `core.worktree`
|
|
430
429
|
# check after them already compares directories, so its own correctness does
|
|
431
430
|
# not depend on `$wt_real`'s spelling either.
|
|
432
431
|
#
|
|
@@ -454,11 +453,11 @@ prefix=$(git -C "$wt" rev-parse --show-prefix) \
|
|
|
454
453
|
# add` can produce.
|
|
455
454
|
#
|
|
456
455
|
# `core.worktree` redirection is NOT caught by either check so far, whatever an
|
|
457
|
-
# earlier version of this comment claimed
|
|
456
|
+
# earlier version of this comment claimed:
|
|
458
457
|
# `--show-prefix` is empty at rc 0 for every redirect shape measured, and this
|
|
459
458
|
# owner check passes the two it can see — `$gd` is $wt's own admin dir with its
|
|
460
459
|
# back-pointer intact when the redirect sits in `config.worktree`, and a foreign
|
|
461
|
-
# git dir not named `.git` is the ceiling's admitted shape. The canonical
|
|
460
|
+
# git dir not named `.git` is the ceiling's admitted shape. The canonical
|
|
462
461
|
# redirect, a foreign git dir literally named `.git`, IS refused here, by the
|
|
463
462
|
# `${gd%/.git}` owner compare, not by `--show-prefix`. The working-tree compare
|
|
464
463
|
# after this block is what refuses the rest.
|
|
@@ -475,7 +474,7 @@ prefix=$(git -C "$wt" rev-parse --show-prefix) \
|
|
|
475
474
|
# `core.worktree` target whose real directory name itself ends in a literal
|
|
476
475
|
# newline byte loses that byte on whichever side of a compare below reads it,
|
|
477
476
|
# so two directories differing only by that byte compare equal — a redirect
|
|
478
|
-
# this script exists to refuse instead reads clean (measured
|
|
477
|
+
# this script exists to refuse instead reads clean (measured). `git
|
|
479
478
|
# worktree add`/`git config core.worktree` both accept the byte as an
|
|
480
479
|
# ordinary path character; nothing upstream rejects it.
|
|
481
480
|
#
|
|
@@ -521,12 +520,12 @@ fi
|
|
|
521
520
|
# not called `.git` whose `core.worktree` is `<dir>`: all pass both checks, and
|
|
522
521
|
# `status` then compares the index against `<dir>`'s files. `<dir>` holding the
|
|
523
522
|
# tracked content — any other checkout of the branch — reads `clean` at rc 0
|
|
524
|
-
# over the work sitting in $wt (measured, git 2.50.1
|
|
523
|
+
# over the work sitting in $wt (measured, git 2.50.1). A `<dir>` INSIDE
|
|
525
524
|
# $wt is the same leak for every file outside it.
|
|
526
525
|
#
|
|
527
526
|
# `--show-toplevel` names the working tree git actually answers for, so it is
|
|
528
527
|
# compared against `$wt_real`, and the union of this with the checks above is
|
|
529
|
-
# the guard: none is dropped, since this one passes the
|
|
528
|
+
# the guard: none is dropped, since this one passes the sibling spoof and
|
|
530
529
|
# a foreign `*/.git` whose `core.worktree` names $wt back. The raw-compare
|
|
531
530
|
# false refusals the `--show-prefix` comment warns about do not arise here:
|
|
532
531
|
# measured passing on a relative, symlinked and `/private`-less `$wt`, after
|
|
@@ -534,12 +533,12 @@ fi
|
|
|
534
533
|
# `--separate-git-dir` clone and a `core.worktree` naming $wt itself.
|
|
535
534
|
#
|
|
536
535
|
# Compared as a DIRECTORY (`-ef`, same device and inode), never as a string,
|
|
537
|
-
# for reap.sh's reason
|
|
536
|
+
# for reap.sh's reason: a worktree whose name is Unicode NFD-composed
|
|
538
537
|
# (`cafe` + U+0301), passed in the PRECOMPOSED spelling `worktree list
|
|
539
538
|
# --porcelain` echoes under the `core.precomposeunicode` git writes into every
|
|
540
539
|
# new repo on macOS, keeps that spelling through `cd && pwd -P`, while
|
|
541
540
|
# `--show-toplevel` answers the on-disk NFD bytes — visually identical,
|
|
542
|
-
# byte-different, one directory (measured, git 2.50.1, Apple Git-155
|
|
541
|
+
# byte-different, one directory (measured, git 2.50.1, Apple Git-155).
|
|
543
542
|
# A byte compare refused every such healthy worktree. `-ef` answers "same
|
|
544
543
|
# directory" for both and for any other spelling the filesystem aliases, and
|
|
545
544
|
# still refuses every redirect — each names a different directory.
|
|
@@ -599,7 +598,7 @@ git -C "$wt" rev-parse --verify "$branch_rev" >/dev/null \
|
|
|
599
598
|
# (`check-ref-format` rejects it, `git branch` refuses to create it), so
|
|
600
599
|
# `$base`, `$branch` and `$fork` cannot carry one.
|
|
601
600
|
#
|
|
602
|
-
# `-uall
|
|
601
|
+
# `-uall` (see reap.sh's branch sweep for the full explanation) — a
|
|
603
602
|
# bare `--porcelain` reads clean over a dirty tree under
|
|
604
603
|
# `status.showUntrackedFiles = no`. Load-bearing here beyond a reap: the merge
|
|
605
604
|
# bot leans on this audit to authorize a REBASE, and the work a rebase
|
|
@@ -660,7 +659,7 @@ fi
|
|
|
660
659
|
# 000` on the same file — same rc pair, same `show-ref` stderr, measured. So
|
|
661
660
|
# the line this branch prints names three causes for four, and `ls -l` on the
|
|
662
661
|
# two files, which is what the runbook sends the operator to read next, shows a
|
|
663
|
-
# healthy mode for that row. Widening either is
|
|
662
|
+
# healthy mode for that row. Widening either is out of scope here.
|
|
664
663
|
#
|
|
665
664
|
# `rev-parse --verify --quiet` cannot do this job: it returns 1 for the
|
|
666
665
|
# unreadable ref FILE for the same reason the list is empty, collapsing that
|
|
@@ -671,7 +670,7 @@ fi
|
|
|
671
670
|
# rc 1 says the REF is absent. It does not say the stash is empty, and the
|
|
672
671
|
# `ref file DELETED` row is the difference: `rm -f .git/refs/stash` leaves the
|
|
673
672
|
# reflog naming commits that are still reachable, and `show-ref` answers 1 for
|
|
674
|
-
# it exactly as it does for a repo that never stashed
|
|
673
|
+
# it exactly as it does for a repo that never stashed. So rc 1 buys a
|
|
675
674
|
# second question rather than a verdict — is the reflog gone too? Only then is
|
|
676
675
|
# `0` a claim this can make. It composes with the discriminant above rather
|
|
677
676
|
# than replacing it: the three states that land on rc 0/128 never reach the
|
|
@@ -700,7 +699,7 @@ fi
|
|
|
700
699
|
# ceiling here and never printed the `0` this once recorded: the path
|
|
701
700
|
# resolution needs search permission on every ancestor, so it fails before the
|
|
702
701
|
# `-s` stat, and it now answers unknown on its own line rather than refusing
|
|
703
|
-
# the whole audit (
|
|
702
|
+
# the whole audit (see the resolution below).
|
|
704
703
|
# `core.logAllRefUpdates=false` is NOT a second one: it suppresses the HEAD
|
|
705
704
|
# reflog, but `git stash push` force-creates `logs/refs/stash` regardless, so
|
|
706
705
|
# such a repo probes normally and reports `unknown` (measured, git 2.50.1).
|
|
@@ -708,7 +707,7 @@ fi
|
|
|
708
707
|
# This does not close every unreadable reflog: one that is merely TRUNCATED —
|
|
709
708
|
# some entries lost, the rest still parses — resolves the ref and returns a
|
|
710
709
|
# nonempty list, so the cross-check sees no disagreement and reports the
|
|
711
|
-
# (too-low) count as exact. That gap is a remaining ceiling.
|
|
710
|
+
# (too-low) count as exact. That gap is a remaining ceiling. A
|
|
712
711
|
# characterization test pins it without closing it — closing it was ruled out
|
|
713
712
|
# separately as not worth the complexity.
|
|
714
713
|
#
|
|
@@ -721,7 +720,7 @@ fi
|
|
|
721
720
|
# signal, which is why the list is captured rather than piped: `| wc -l` made
|
|
722
721
|
# this statement's status `wc`'s, always 0, and git's own rc unrecoverable.
|
|
723
722
|
# Nothing else moves — the count is still the lines the list printed, its stderr
|
|
724
|
-
# is still dropped here, and a list that succeeds is still read as a count.
|
|
723
|
+
# is still dropped here, and a list that succeeds is still read as a count.
|
|
725
724
|
#
|
|
726
725
|
# Only the CORRUPT half of that shape is loud. A non-tip object that is MISSING
|
|
727
726
|
# rather than corrupt leaves the reflog intact too, but `stash list` then skips
|
|
@@ -729,7 +728,7 @@ fi
|
|
|
729
728
|
# (measured: three entries, `rm` the loose object behind `refs/stash@{2}` ->
|
|
730
729
|
# rc 0, two lines, empty stderr, git 2.50.1). Nothing here can tell that from a
|
|
731
730
|
# genuinely shorter stack, so it still reports the exact-looking count and stays
|
|
732
|
-
# under the
|
|
731
|
+
# under the truncated-reflog ceiling above.
|
|
733
732
|
sl_rc=0
|
|
734
733
|
sl=$(git -C "$wt" stash list 2>/dev/null) || sl_rc=$?
|
|
735
734
|
# `awk 'END{print NR}'`, not `wc -l`, and the difference is the empty stack.
|
|
@@ -763,7 +762,7 @@ git -C "$wt" show-ref refs/stash >/dev/null 2>&1 || sr_rc=$?
|
|
|
763
762
|
# path lands on `[ -s "" ]`, false, and prints the confident `0`; the state
|
|
764
763
|
# gets its own emission below instead of falling through to one. git's own
|
|
765
764
|
# `fatal:` naming the path and the errno is left on stderr, unwrapped, as the
|
|
766
|
-
# operator's whole lead on which directory to look at.
|
|
765
|
+
# operator's whole lead on which directory to look at.
|
|
767
766
|
stash_reflog=
|
|
768
767
|
stash_reflog_rc=0
|
|
769
768
|
if [ "$stash" = 0 ] && [ "$sr_rc" = 1 ]; then
|
|
@@ -777,7 +776,7 @@ fi
|
|
|
777
776
|
# ref, and it is the more specific of the two there. What is left for the rc is
|
|
778
777
|
# the state no cross-check can reach: git printed entries and then said it could
|
|
779
778
|
# not finish, so the ref resolves, nothing disagrees, and the number would be
|
|
780
|
-
# short by exactly the entries git refused to read
|
|
779
|
+
# short by exactly the entries git refused to read.
|
|
781
780
|
msg=
|
|
782
781
|
if [ "$stash" = 0 ] && [ "$sr_rc" -ne 1 ]; then
|
|
783
782
|
msg=" stash entries (repo-global, not gated): unknown — the list came back empty but refs/stash is not absent (an unreadable ref or reflog, or a ref pointing at a missing object)"
|
|
@@ -799,7 +798,7 @@ if [ -n "$msg" ]; then
|
|
|
799
798
|
# for BOTH the unreadable and the malformed ref file: one canned line for two
|
|
800
799
|
# causes, naming a null SHA that neither ref holds. It is silent only for the
|
|
801
800
|
# unreadable reflog. Whether that wrong-but-specific line beats this
|
|
802
|
-
# right-but-vague one is
|
|
801
|
+
# right-but-vague one is a separate question; this change captures `stash list` and nothing
|
|
803
802
|
# else.
|
|
804
803
|
#
|
|
805
804
|
# The counting statement above takes git's exit code and nothing else, and
|
|
@@ -809,7 +808,7 @@ if [ -n "$msg" ]; then
|
|
|
809
808
|
# healthy audit to serve the one path that has already decided something is
|
|
810
809
|
# wrong. Here the second call costs nothing: it runs only on a run that is
|
|
811
810
|
# already reporting a fault, which now includes the run whose rc brought it
|
|
812
|
-
# here.
|
|
811
|
+
# here.
|
|
813
812
|
#
|
|
814
813
|
# `2>&1 >/dev/null` in that order captures stderr and drops stdout — the list
|
|
815
814
|
# itself is not wanted, it was already counted. `|| true` is load-bearing
|
|
@@ -930,7 +929,7 @@ git -C "$wt" merge-tree --write-tree --name-only -z "$base_rev" "$branch_rev" >"
|
|
|
930
929
|
# confidence — the false safe the prologue describes, and precisely the outcome
|
|
931
930
|
# the standard below says must be exit 2 instead. `export LC_ALL=C` answers the
|
|
932
931
|
# one byte that was measured getting in; it cannot make a status readable, and
|
|
933
|
-
# any other fault in a prefix stage reproduces the under-report.
|
|
932
|
+
# any other fault in a prefix stage reproduces the under-report.
|
|
934
933
|
#
|
|
935
934
|
# `set -o pipefail` is NOT the alternative, and not merely because POSIX sh
|
|
936
935
|
# lacks it (dash rejects `set -o pipefail` outright). Measured: a healthy
|
|
@@ -940,7 +939,7 @@ git -C "$wt" merge-tree --write-tree --name-only -z "$base_rev" "$branch_rev" >"
|
|
|
940
939
|
# tail unread, and once that tail outgrows a pipe buffer whatever is upstream is
|
|
941
940
|
# still writing when the reader goes away. `pipefail` would turn every such run
|
|
942
941
|
# into a refusal, which is a worse failure than the one it fixes. The control
|
|
943
|
-
# for that is a test rather than this paragraph:
|
|
942
|
+
# for that is a test rather than this paragraph: the test suite builds a
|
|
944
943
|
# run whose unread tail outgrows a pipe buffer and requires a full answer.
|
|
945
944
|
#
|
|
946
945
|
# One reader answers both questions, so there is nothing left to discard a
|
|
@@ -982,7 +981,7 @@ if [ -n "$conflicts" ]; then
|
|
|
982
981
|
else
|
|
983
982
|
emit " no conflicting files"
|
|
984
983
|
fi
|
|
985
|
-
# `jarr`/`jarr_rewritten` return non-zero when a stage fails
|
|
984
|
+
# `jarr`/`jarr_rewritten` return non-zero when a stage fails, and a bare
|
|
986
985
|
# `var=$(pipeline)` under `set -eu` would abort with the failing tool's own
|
|
987
986
|
# status — 1 out of THIS script is the dirty-worktree refusal, fabricated here
|
|
988
987
|
# on a worktree already measured clean, with no payload and nothing on stderr.
|
|
@@ -1019,7 +1018,7 @@ if [ -n "$conflicts" ]; then
|
|
|
1019
1018
|
# nothing sits ahead of it with a status to discard. It used to be
|
|
1020
1019
|
# `printf | sed | tr | xargs`, where the `|| die` could only ever answer for
|
|
1021
1020
|
# the last of the four and a fault in any of the other three under-reported
|
|
1022
|
-
# `at_risk` at exit 0.
|
|
1021
|
+
# `at_risk` at exit 0.
|
|
1023
1022
|
at_risk=$(xargs -0 git -C "$wt" log --oneline "$fork".."$base_rev" -- <"$ps_out") \
|
|
1024
1023
|
|| die "listing commits for the conflicting paths failed (git log or xargs) — cannot tell what a resolution would eat"
|
|
1025
1024
|
# Above ARG_MAX (1048576 on macOS) xargs splits the pathspec list across
|
|
@@ -1080,7 +1079,7 @@ fi
|
|
|
1080
1079
|
# out. Assigned first, each one is a simple command whose status `add_field`
|
|
1081
1080
|
# can read.
|
|
1082
1081
|
#
|
|
1083
|
-
# `die` is NOT the answer here
|
|
1082
|
+
# `die` is NOT the answer here, unlike the conflicts and at-risk escapes
|
|
1084
1083
|
# above, and the difference is which kind of value each renders. Those two are
|
|
1085
1084
|
# FINDINGS — the operator can obtain them nowhere else, and step 5 of the
|
|
1086
1085
|
# no-undo runbook hands `conflicts[]` straight to `git diff -- <path>`, where an
|
|
@@ -1093,7 +1092,7 @@ fi
|
|
|
1093
1092
|
# payload carries is established, and a formatter breaking HERE would convert a
|
|
1094
1093
|
# finished audit into "unanswerable" over the formatting of two values the
|
|
1095
1094
|
# caller typed. Each renders independently and reports JSON `null` when it
|
|
1096
|
-
# cannot, which is what
|
|
1095
|
+
# cannot, which is what inflight.sh does for this same class. Not a
|
|
1097
1096
|
# quieter `""`: a field that could not be escaped has no usable path to hand to
|
|
1098
1097
|
# `git diff` in any case, and `""` is indistinguishable from a path.
|
|
1099
1098
|
#
|