Skip to content

Commit 94bec44

Browse files
authored
Fix commits_since_last_tag in version info (#9730)
## Summary Before: ```console $ cargo run -- --version uv 0.5.7 (b17902d 2024-12-09) ``` After: ```console $ cargo run -- --version uv 0.5.7+14 (7cd0ab7 2024-12-09) ``` Currently `cargo run -- --version` does not includes the number of commits since last tag, because `cargo-dist` create non-annotated tag, and `git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe)'` use only annoated tags by default. ```console $ git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe)' 7cd0ab7 7cd0ab7 2024-12-09 ``` To include these tags, use `git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe:tags)'`, which will display: ```console $ git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe:tags)' 7cd0ab7 7cd0ab7 2024-12-09 0.5.7-14-g7cd0ab77a ```
1 parent 1ddcc15 commit 94bec44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/uv-cli/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn commit_info(workspace_root: &Path) {
5555
.arg("-1")
5656
.arg("--date=short")
5757
.arg("--abbrev=9")
58-
.arg("--format=%H %h %cd %(describe)")
58+
.arg("--format=%H %h %cd %(describe:tags)")
5959
.output()
6060
{
6161
Ok(output) if output.status.success() => output,

0 commit comments

Comments
 (0)