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-08 12:34:13-08:00
log1eb729b9b9a03f896e06001d9791e55753c60dfa
tree8775a78438fc8db93cf319bbe648b6cbe8cc6ee7
parent0bce4a4e05ef377b82667997870e73a11dc98c88

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 {
257257 var code: u8 = undefined;
258258 const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{
259259 "git",
260 "-C",
261 b.build_root.path orelse ".",
262 "describe",
263 "--match",
264 "*.*.*",
265 "--tags",
266 "--abbrev=9",
260 "-C", b.build_root.path orelse ".", // affects the --git-dir argument
261 "--git-dir", ".git", // affected by the -C argument
262 "describe", "--match", "*.*.*", //
263 "--tags", "--abbrev=9",
267264 }, &code, .Ignore) catch {
268265 break :v version_string;
269266 };