From 17086c8ca3b05602459c648a1372ccc37fcee640 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Sat, 8 Aug 2026 22:41:58 -0700 Subject: [PATCH] Count the dirty files instead of string-testing them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An empty command substitution expands to zero arguments in fish, so `test -n (git status --porcelain -- silo/)` became a bare `test -n` — true — and every clean deploy announced itself as shipping uncommitted files. A dirty flag that is always set is worth exactly as much as a fleet that is always stale. --- silo/deploy.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/silo/deploy.fish b/silo/deploy.fish index 1b59b241ab..bdb2182baf 100755 --- a/silo/deploy.fish +++ b/silo/deploy.fish @@ -90,8 +90,12 @@ else # silo/ file ships while the stamp still names HEAD — provenance that reads # clean and is not. Say so rather than let the fleet believe a sha that does # not contain what is running. + # Counted, not string-tested: an empty command substitution expands to zero + # arguments, so `test -n (...)` becomes a bare `test -n` — which is true, + # and would have marked every clean deploy dirty. set -l DIRTY 0 - if test -n (git -C $SCRIPT_DIR/.. status --porcelain -- silo/ | head -1) + set -l silo_changes (git -C $SCRIPT_DIR/.. status --porcelain -- silo/) + if test (count $silo_changes) -gt 0 set DIRTY 1 end if test -n "$SHA" -- 2.51.2