Skip to content

Commit

Permalink
Reapply "build: Don't check parent directories for git tag"
Browse files Browse the repository at this point in the history
This reverts commit 7e0c25e.

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.
  • Loading branch information
andrewrk committed Mar 8, 2025
1 parent 0bce4a4 commit 1eb729b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 1eb729b

Please sign in to comment.