@feigi/fleet-ctl 3.28.1 → 3.28.3
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/reap.sh +8 -9
- package/scripts/worktree.sh +23 -7
package/package.json
CHANGED
package/scripts/reap.sh
CHANGED
|
@@ -300,8 +300,8 @@ warnings=""
|
|
|
300
300
|
# because none happened or because nothing reports them.
|
|
301
301
|
removed=""
|
|
302
302
|
# `jstr`'s output wrapped in the quotes JSON needs, or the literal `null` where
|
|
303
|
-
# it could not render. `die` is the wrong answer at
|
|
304
|
-
# the time
|
|
303
|
+
# it could not render. `die` is the wrong answer at every call site below: by
|
|
304
|
+
# the time any accumulator is written this script may already have deleted
|
|
305
305
|
# branches, and the payload printed at the end is the caller's only record of
|
|
306
306
|
# that — the same reason the printf runs ahead of the prune. Exiting here
|
|
307
307
|
# would destroy the record of work that already happened. So an unrenderable
|
|
@@ -314,8 +314,9 @@ removed=""
|
|
|
314
314
|
#
|
|
315
315
|
# Five interpolations converge on this function: the branch name, `dirty
|
|
316
316
|
# worktree $wt`, `ignored files present in $wt: $ignored`, `cherry probe
|
|
317
|
-
# failed …: $cherry` (arbitrary git stderr) — the first four via `keep`,
|
|
318
|
-
#
|
|
317
|
+
# failed …: $cherry` (arbitrary git stderr) — the first four via `keep`, whose
|
|
318
|
+
# own `jfield "$1"` / `jfield "$2"` every `keep` call carrying one of them
|
|
319
|
+
# reaches — and the `reaped` accumulator, which calls `jfield`
|
|
319
320
|
# directly and never routes through `keep` at all. The branch name is the
|
|
320
321
|
# demonstrated trigger — `git branch 'has"quote'` is a legal refname — and raw
|
|
321
322
|
# it emitted a payload no parser accepts at exit 0, while the branch was
|
|
@@ -323,12 +324,10 @@ removed=""
|
|
|
323
324
|
# operator, not JSON.
|
|
324
325
|
#
|
|
325
326
|
# A sixth joined the five above later: grep's own stderr, `$gq_err`,
|
|
326
|
-
# surfaced through `gp_why "$gq_err"` in `keep`'s message at the
|
|
327
|
-
# checks and the
|
|
327
|
+
# surfaced through `gp_why "$gq_err"` in `keep`'s message at the cherry
|
|
328
|
+
# checks and the registry re-reads —
|
|
328
329
|
# arbitrary text on the same footing as `$cherry`, routed through the same
|
|
329
|
-
# jfield/jstr escaping the paragraph above already covers.
|
|
330
|
-
# "eleven call sites" figure above, which still counts only the original
|
|
331
|
-
# five; four more now carry grep's stderr specifically.
|
|
330
|
+
# jfield/jstr escaping the paragraph above already covers.
|
|
332
331
|
jfield() {
|
|
333
332
|
if jf=$(jstr "$1"); then
|
|
334
333
|
printf '"%s"' "$jf"
|
package/scripts/worktree.sh
CHANGED
|
@@ -849,11 +849,17 @@ wt_counts() {
|
|
|
849
849
|
# registered for, and the listing derives each worktree's path from exactly
|
|
850
850
|
# that file — so for the listed path it reads `$1/.git` byte for byte, and
|
|
851
851
|
# through a link to ANOTHER worktree it names that one (measured: a link `A`
|
|
852
|
-
# to sibling `B` reaches `worktrees/B`, whose `gitdir` names `B/.git`).
|
|
853
|
-
#
|
|
854
|
-
#
|
|
855
|
-
#
|
|
856
|
-
#
|
|
852
|
+
# to sibling `B` reaches `worktrees/B`, whose `gitdir` names `B/.git`). Under
|
|
853
|
+
# `worktree.useRelativePaths` git writes that file relative to the admin dir
|
|
854
|
+
# (measured: `../../../../B/.git`), so a relative one is resolved against it
|
|
855
|
+
# first. Then the registered path and $1 are compared as directory ENTRIES:
|
|
856
|
+
# the last component by bytes, because `-ef` on it would follow the link and
|
|
857
|
+
# is what cannot see this, and the parent by `-ef`, so a parent spelled
|
|
858
|
+
# through a symlink (`/tmp` for `/private/tmp`, or `..` segments) still names
|
|
859
|
+
# the same entry. Asked only of a link: a link standing in for the worktree's
|
|
860
|
+
# OWN renamed directory reaches its own admin dir and passes, and a plain
|
|
861
|
+
# directory never needs it — the NFD spelling `-ef` exists for would fail a
|
|
862
|
+
# byte compare.
|
|
857
863
|
#
|
|
858
864
|
# `&& echo x` inside the substitution, then `%?x`: `$(...)` strips EVERY
|
|
859
865
|
# trailing newline, so a `core.worktree` naming a sibling directory called $1
|
|
@@ -919,8 +925,18 @@ EOF
|
|
|
919
925
|
wt_lk_back=${wt_lk_back%x}
|
|
920
926
|
wt_lk_back=${wt_lk_back%"
|
|
921
927
|
"}
|
|
922
|
-
|
|
923
|
-
|
|
928
|
+
wt_lk_back=${wt_lk_back%/.git}
|
|
929
|
+
case $wt_lk_back in
|
|
930
|
+
/*) ;;
|
|
931
|
+
*) wt_lk_back=${wt_lk_admin%?x}/$wt_lk_back ;;
|
|
932
|
+
esac
|
|
933
|
+
case $1 in
|
|
934
|
+
*/*) wt_lk_up=${1%/*} ;;
|
|
935
|
+
*) wt_lk_up=. ;;
|
|
936
|
+
esac
|
|
937
|
+
# shellcheck disable=SC3013 # -ef as below; a `[` that cannot evaluate it fails the `!`, so it refuses
|
|
938
|
+
if [ "${wt_lk_back##*/}" != "${1##*/}" ] || ! [ "${wt_lk_back%/*}/" -ef "$wt_lk_up/" ]; then
|
|
939
|
+
wt_why="$1 is a symbolic link to another worktree's directory — its .git linkage reaches the admin dir registered for $wt_lk_back, not for $1"
|
|
924
940
|
return 1
|
|
925
941
|
fi
|
|
926
942
|
fi
|