Skip to content

Commit

Permalink
Use all tags by default, instead of requiring annotated tags (#298)
Browse files Browse the repository at this point in the history
This is a bit more user friendly, most projects don't use annotated
tags.

This makes sense for linux though, where lighweight tags might just
be markers.
  • Loading branch information
Byron committed Apr 5, 2022
1 parent d5b8fd5 commit 00c42ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion git-repository/src/id.rs
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions src/plumbing/main.rs
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/plumbing/options.rs
Expand Up @@ -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.
Expand Down

0 comments on commit 00c42ca

Please sign in to comment.