Expand description
从 Git tag 读取版本号,作为版本号的事实源之一。
§事实源定位
本模块提供的是事实(scope 名和版本号当前是什么),不涉及规则判断。
规则的判定在 contract::version 中。
§架构
通过 TagSource trait 将 I/O(读取 tag)与业务逻辑(过滤、排序)分离。
§示例
ⓘ
use quanttide_devops::source::git_tag::latest_tag;
let tag = latest_tag(repo_path, "cli")?; // "cli/v0.2.0"
let ver = quanttide_devops::source::git_tag::latest_version(repo_path, "cli")?; // "0.2.0"Structs§
- GixTag
Source - gix 实现的
TagSource。
Enums§
- TagError
- Git tag 读取操作错误。
Traits§
- TagSource
- Tag 列表的抽象来源。
Functions§
- filter_
latest_ tag - 从 tag 列表中选出指定 scope 的最新 tag(原始格式,如
cli/v0.2.0)。 - filter_
latest_ version - 从 tag 列表中选出指定 scope 的最新版本号(标准化,如
0.2.0)。 - filter_
tags_ by_ scope - 从 tag 列表中过滤出指定 scope 的 tag。
- latest_
tag - 获取指定 scope 的最新 tag(原始格式,如
cli/v0.2.0)。 - latest_
tag_ with - 带注入
TagSource的latest_tag。 - latest_
version - 获取指定 scope 的最新版本号(标准化,如
0.2.0)。 - latest_
version_ with - 带注入
TagSource的latest_version。 - parse_
semver_ tag - tags_
for_ scope - 获取指定 scope 的所有 tag(原始格式)。
- tags_
for_ scope_ with - 带注入
TagSource的tags_for_scope。