uv icon indicating copy to clipboard operation
uv copied to clipboard

Fix commits_since_last_tag in version info

Open j178 opened this issue 1 year ago • 0 comments

Summary

Before:

$ cargo run -- --version
uv 0.5.7 (b17902da0 2024-12-09)

After:

$ cargo run -- --version
uv 0.5.7+14 (7cd0ab77a 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.

$ git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe)'
7cd0ab77a91b57f5c101aa0bd46396ede947f330 7cd0ab77a 2024-12-09

To include these tags, use git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe:tags)', which will display:

$ git log -1 --date=short --abbrev=9 --format='%H %h %cd %(describe:tags)'
7cd0ab77a91b57f5c101aa0bd46396ede947f330 7cd0ab77a 2024-12-09 0.5.7-14-g7cd0ab77a

j178 avatar Dec 09 '24 03:12 j178