diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-18 14:43:07 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-12-19 00:54:48 -0800 |
| commit | f545fc28b35b454b2b0167ede45aeacc0cd93387 (patch) | |
| tree | 4c71ae6e0cc5ffa16c2eb14a9f8c166524c2bf06 /build.zig | |
| parent | 90a19f74116eb09e4711d845d08c011cb62b8cbf (diff) | |
| download | zig-f545fc28b35b454b2b0167ede45aeacc0cd93387.tar.gz zig-f545fc28b35b454b2b0167ede45aeacc0cd93387.zip | |
build: pass --abbrev to git rather than relying on global config
For computing the zig version number, pass --abbrev=9 rather than
requiring the user to set their git configuration in order to make zig
versions match the standard.
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -263,7 +263,14 @@ 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", + "git", + "-C", + b.build_root.path orelse ".", + "describe", + "--match", + "*.*.*", + "--tags", + "--abbrev=9", }, &code, .Ignore) catch { break :v version_string; }; |
