authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-03-08 12:27:43-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-03-09 12:06:59-07:00
log71e2f653cf3b53b4b9228f1c829d6bfe351fa453
treee130b379b7c11e199c8caca88f96c80ee4353825
parent2ef72f84ca3cc74b24c3a89e52c72dce66e31638

Reapply "build: Don't check parent directories for git tag"

This reverts commit 7e0c25eccd8d9bc5b77953dbc9a39a26e383c550. The `--git-dir` argument is relative to the `-C` argument, making this patch OK after all. I added a comment to go along with this since I found it confusing. Apologies for the revert.

1 files changed, 4 insertions(+), 7 deletions(-)

build.zig+4-7
...@@ -257,13 +257,10 @@ pub fn build(b: *std.Build) !void {...@@ -257,13 +257,10 @@ pub fn build(b: *std.Build) !void {
257 var code: u8 = undefined;257 var code: u8 = undefined;
258 const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{258 const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{
259 "git",259 "git",
260 "-C",260 "-C", b.build_root.path orelse ".", // affects the --git-dir argument
261 b.build_root.path orelse ".",261 "--git-dir", ".git", // affected by the -C argument
262 "describe",262 "describe", "--match", "*.*.*", //
263 "--match",263 "--tags", "--abbrev=9",
264 "*.*.*",
265 "--tags",
266 "--abbrev=9",
267 }, &code, .Ignore) catch {264 }, &code, .Ignore) catch {
268 break :v version_string;265 break :v version_string;
269 };266 };