From 1360b89a28fddd265343363de05ed481e73eff5a Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 24 Apr 2026 13:26:25 -0700 Subject: [PATCH] build-notepat: tighten gitDirty check to tracked-file changes only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit \`git status --porcelain\` counts untracked files, so deploy.fish's system/public/.commit-ref (written post git reset --hard) made every lith build's version look "-dirty" even though the tree matched origin/main exactly. Switching to \`git diff --quiet HEAD --\` which only considers tracked modifications — no effect on dev builds with actual uncommitted changes. Also gitignores .commit-ref for good measure. --- .gitignore | 2 ++ ac-m4l/build-notepat.mjs | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 025d503f6..4ffac2bfb 100644 --- a/.gitignore +++ b/.gitignore @@ -344,6 +344,8 @@ ac-vst/vst3sdk/ # + the root alias (notepat.com.amxd above) but don't bloat the repo # with per-build binaries. system/public/m4l/notepat.com/*.amxd +# deploy.fish writes this post-pull on lith — not a dev artifact. +system/public/.commit-ref # Emacs performance logs (keep directory, ignore log files) .emacs-logs/*.log diff --git a/ac-m4l/build-notepat.mjs b/ac-m4l/build-notepat.mjs index a6b9b1ff6..2f30ae193 100644 --- a/ac-m4l/build-notepat.mjs +++ b/ac-m4l/build-notepat.mjs @@ -48,13 +48,15 @@ function gitHash() { } function gitDirty() { + // Only tracked-file modifications count as "dirty" for versioning — + // stray untracked files on the server (like deploy.fish's + // system/public/.commit-ref) shouldn't make every deploy's version + // look like a dev build. try { - const out = execSync("git status --porcelain", { cwd: REPO_ROOT }) - .toString() - .trim(); - return out.length > 0; - } catch { + execSync("git diff --quiet HEAD --", { cwd: REPO_ROOT, stdio: "pipe" }); return false; + } catch { + return true; } } -- 2.51.2