From a56b15320444fcfe3aabdd3768c81c733f3d776b Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 29 Aug 2026 00:35:58 -0700 Subject: Bake the short git commit hash (plus -dirty suffix) into the binary and trace it at startup alongside the build timestamp. A --logfile trace could previously only be tied back to a build timestamp, not the exact source state -- distinguishing same-day rebuilds during A/B testing required diffing binaries. GIT_COMMIT is injected via GNUmakefile (git rev-parse --short HEAD, kept out of the PROFILE variable itself since PROFILE gets separately stringified whole for the "Make profile used" trace line, and this value's embedded quotes broke that outer string literal when first tried folded in there). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01EortUUkDVpsfrbqshBJYJg --- src/chess.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/chess.h') diff --git a/src/chess.h b/src/chess.h index 15f6ca8..b6175f7 100755 --- a/src/chess.h +++ b/src/chess.h @@ -209,6 +209,13 @@ typedef struct _DLIST_ENTRY #define VERSION "1.00" #define REVISION "$Id: chess.h 354 2008-06-30 05:10:08Z scott $\n" +// GIT_COMMIT is normally injected by GNUmakefile via -DGIT_COMMIT (short +// hash, plus a -dirty suffix if the tree had uncommitted changes at build +// time); this is just a fallback for any build path that doesn't set it. +#ifndef GIT_COMMIT +#define GIT_COMMIT "unknown" +#endif + // // Function decorators // -- cgit v1.3