commit 71e2f653cf3b53b4b9228f1c829d6bfe351fa453 (tree)
parent 2ef72f84ca3cc74b24c3a89e52c72dce66e31638
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sat, 8 Mar 2025 12:27:43 -0800
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.
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/build.zig b/build.zig
@@ -257,13 +257,10 @@ pub fn build(b: *std.Build) !void {
var code: u8 = undefined;
const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{
"git",
- "-C",
- b.build_root.path orelse ".",
- "describe",
- "--match",
- "*.*.*",
- "--tags",
- "--abbrev=9",
+ "-C", b.build_root.path orelse ".", // affects the --git-dir argument
+ "--git-dir", ".git", // affected by the -C argument
+ "describe", "--match", "*.*.*", //
+ "--tags", "--abbrev=9",
}, &code, .Ignore) catch {
break :v version_string;
};