From d749c8cd87508871dc28b528f57d26b1004007b3 Mon Sep 17 00:00:00 2001 From: alaviss Date: Sun, 14 Jun 2020 04:22:55 -0500 Subject: [PATCH] compiler/commands: make gitHash settable at compile-time. (#14654) This is useful for building nightlies, since we will be building from a generated source archive and git metadata is lost there. --- compiler/commands.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/commands.nim b/compiler/commands.nim index 2d84181398..c945a633a9 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -98,7 +98,7 @@ proc writeVersionInfo(conf: ConfigRef; pass: TCmdLinePass) = CPU[conf.target.hostCPU].name, CompileDate]), {msgStdout}) - const gitHash = gorge("git log -n 1 --format=%H").strip + const gitHash {.strdefine.} = gorge("git log -n 1 --format=%H").strip when gitHash.len == 40: msgWriteln(conf, "git hash: " & gitHash, {msgStdout})