diff options
| author | Scott Gasch <[email protected]> | 2026-08-29 00:35:58 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-08-29 00:35:58 -0700 |
| commit | a56b15320444fcfe3aabdd3768c81c733f3d776b (patch) | |
| tree | a2e42365500be22bb5c5023159c3c1dad49f4230 /src/chess.h | |
| parent | 917bf1260ae217bdcbdbc11c2c37cdb5d3a8eae9 (diff) | |
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EortUUkDVpsfrbqshBJYJg
Diffstat (limited to 'src/chess.h')
| -rwxr-xr-x | src/chess.h | 7 |
1 files changed, 7 insertions, 0 deletions
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 // |
