From 504021f2c738e0b49f299be62ec20f63d7df8338 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Thu, 3 Dec 2026 22:28:49 +0100 Subject: [PATCH] build_version.py: builds with staged but uncommitted changes are now marked dirty (+) Co-Authored-By: Claude Opus 5.5 --- tools/build_version.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/build_version.py b/tools/build_version.py index 169339bae..a7ada3af9 100644 --- a/tools/build_version.py +++ b/tools/build_version.py @@ -70,7 +70,9 @@ except Exception: sha, dirty = "nogit", "" try: sha = git(cwd, "rev-parse", "--short=7", "HEAD") - if subprocess.call(["git", "diff", "--quiet"], cwd=cwd) != 0: + # against HEAD: staged changes count too (a plain `git diff` sees only + # unstaged ones, so a build from a staged tree came out as a clean commit) + if subprocess.call(["git", "diff", "--quiet", "HEAD"], cwd=cwd) != 0: dirty = "+" except Exception: pass