git_sha
git_sha synchronously waits for dependencies, then resolves a revision in a local Git repository. It returns the full SHA-1 or SHA-256 commit ID as a string. If the repository cannot be opened or the revision cannot be resolved to a commit, it returns None.
This function only reads the local repository. It does not fetch refs or objects. Annotated tags resolve to their target commits.
Arguments
| Argument | Required | Description |
|---|---|---|
revision | No | Revision or revision expression to resolve. Defaults to HEAD. |
repository | No | Project-relative Git repository directory. Defaults to .. |
deps | No | Dependencies to complete before resolving the revision. |
Example
load("@git@1", "git_sha")
current = git_sha()
release = git_sha("v1.0.0")