Skip to content

Commit 9297271

Browse files
Add BZ_COMMIT documentation to the reference
1 parent c1d44e7 commit 9297271

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/buildzri/reference.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,24 @@ Python code snippet.
157157

158158
Shortname of the `BZ_ARCHL` value. i.e.,: This variable will return `x64` instead of `amd64` or `x86_64`.
159159

160+
### `BZ_COMMIT`
161+
162+
The latest commit hash of the Git repository. This value is extracted by using the following Git command via
163+
the Python script:
164+
165+
```bash
166+
git log -n 1 main --pretty=format:"%H"
167+
```
168+
169+
Example usage:
170+
171+
```json
172+
"definitions": {
173+
"*": [
174+
"PROGRAM_COMMIT=\\\"${BZ_COMMIT}\\\""
175+
],
176+
```
177+
160178
## Cross-platform definitions
161179

162180
BuildZri is a cross-platform C/C++ build tool, so how to define configuration values for each operating system?

0 commit comments

Comments
 (0)