diff --git a/git-repository/src/id.rs b/git-repository/src/id.rs index c7a839c7ff..34e74d35ab 100644 --- a/git-repository/src/id.rs +++ b/git-repository/src/id.rs @@ -49,7 +49,7 @@ impl<'repo> Id<'repo> { fn calculate_auto_hex_len(num_packed_objects: u64) -> usize { let mut len = 64 - num_packed_objects.leading_zeros(); - len = (len + 2 - 1) / 2; + len = (len + 1) / 2; len.max(7) as usize } diff --git a/src/plumbing/main.rs b/src/plumbing/main.rs index 2447650bfd..00afd0a50e 100644 --- a/src/plumbing/main.rs +++ b/src/plumbing/main.rs @@ -159,7 +159,7 @@ pub fn main() -> Result<()> { Subcommands::Repository(repo::Platform { repository, cmd }) => match cmd { repo::Subcommands::Commit { cmd } => match cmd { repo::commit::Subcommands::Describe { - all_tags, + annotated_tags, all_refs, first_parent, always, @@ -180,7 +180,7 @@ pub fn main() -> Result<()> { out, err, core::repository::commit::describe::Options { - all_tags, + all_tags: !annotated_tags, all_refs, long_format: long, first_parent, diff --git a/src/plumbing/options.rs b/src/plumbing/options.rs index 70027da4ff..80d3a9647b 100644 --- a/src/plumbing/options.rs +++ b/src/plumbing/options.rs @@ -395,12 +395,12 @@ pub mod repo { pub enum Subcommands { /// Describe the current commit or the given one using the name of the closest annotated tag in its ancestry. Describe { - /// Use all tag references for naming, not only annotated tags. + /// Use annotated tag references only, not all tags. #[clap(long, short = 't', conflicts_with("all-refs"))] - all_tags: bool, + annotated_tags: bool, /// Use all references under the `ref/` namespaces, which includes tag references, local and remote branches. - #[clap(long, short = 'a', conflicts_with("all-tags"))] + #[clap(long, short = 'a', conflicts_with("annotated-tags"))] all_refs: bool, /// Only follow the first parent when traversing the commit graph.