+24
-16
lines changedFilter options
+24
-16
lines changed Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
1
1
pub fn list(repo: gix::Repository, out: &mut dyn std::io::Write) -> anyhow::Result<()> {
2
2
let platform = repo.references()?;
3
3
4
-
for mut reference in (platform.tags()?).flatten() {
4
+
for mut reference in platform.tags()?.flatten() {
5
5
let tag = reference.peel_to_tag();
6
6
let tag_ref = tag.as_ref().map(gix::Tag::decode);
7
7
8
-
// `name` is the name of the file in `refs/tags/`. This applies to both lightweight as well
9
-
// as annotated tags.
8
+
// `name` is the name of the file in `refs/tags/`.
9
+
// This applies to both lightweight and annotated tags.
10
10
let name = reference.name().shorten();
11
-
11
+
let mut fields = Vec::new();
12
12
match tag_ref {
13
13
Ok(Ok(tag_ref)) => {
14
-
// `tag_name` is the name provided by the user via `git tag -a/-s/-u`. It is only
15
-
// present for annotated tags.
16
-
let tag_name = tag_ref.name;
17
-
18
-
if name == tag_name {
19
-
writeln!(out, "{name} *")?;
20
-
} else {
21
-
writeln!(out, "{name} [tag name: {}]", tag_ref.name)?;
14
+
// `tag_name` is the name provided by the user via `git tag -a/-s/-u`.
15
+
// It is only present for annotated tags.
16
+
fields.push(format!(
17
+
"tag name: {}",
18
+
if name == tag_ref.name { "*".into() } else { tag_ref.name }
19
+
));
20
+
if tag_ref.pgp_signature.is_some() {
21
+
fields.push("signed".into());
22
22
}
23
+
24
+
writeln!(out, "{name} [{fields}]", fields = fields.join(", "))?;
23
25
}
24
26
_ => {
25
27
writeln!(out, "{name}")?;
Original file line number Diff line number Diff line change
@@ -1304,8 +1304,8 @@ pub fn main() -> Result<()> {
1304
1304
},
1305
1305
),
1306
1306
},
1307
-
Subcommands::Tag(cmd) => match cmd {
1308
-
tag::Subcommands::List => prepare_and_run(
1307
+
Subcommands::Tag(platform) => match platform.cmds {
1308
+
Some(tag::Subcommands::List) | None => prepare_and_run(
1309
1309
"tag-list",
1310
1310
trace,
1311
1311
auto_verbose,
Original file line number Diff line number Diff line change
@@ -101,8 +101,8 @@ pub enum Subcommands {
101
101
#[clap(subcommand)]
102
102
Commit(commit::Subcommands),
103
103
/// Interact with tag objects.
104
-
#[clap(subcommand)]
105
-
Tag(tag::Subcommands),
104
+
#[clap(visible_alias = "tags")]
105
+
Tag(tag::Platform),
106
106
/// Verify the integrity of the entire repository
107
107
Verify {
108
108
#[clap(flatten)]
@@ -932,6 +932,12 @@ pub mod commit {
932
932
}
933
933
934
934
pub mod tag {
935
+
#[derive(Debug, clap::Parser)]
936
+
pub struct Platform {
937
+
#[clap(subcommand)]
938
+
pub cmds: Option<Subcommands>,
939
+
}
940
+
935
941
#[derive(Debug, clap::Subcommand)]
936
942
pub enum Subcommands {
937
943
/// List all tags.
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4