File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,6 +156,22 @@ pub fn main() -> Result<()> {
156156 ) ,
157157 } ,
158158 Subcommands :: Repository ( repo:: Platform { repository, cmd } ) => match cmd {
159+ repo:: Subcommands :: Describe { cmd } => match cmd {
160+ repo:: commit:: Subcommands :: Describe {
161+ all_tags,
162+ all_refs,
163+ first_parent,
164+ always,
165+ rev_spec,
166+ } => prepare_and_run (
167+ "repository-commit-describe" ,
168+ verbose,
169+ progress,
170+ progress_keep_open,
171+ None ,
172+ move |_progress, out, err| todo ! ( ) ,
173+ ) ,
174+ } ,
159175 repo:: Subcommands :: Mailmap { cmd } => match cmd {
160176 repo:: mailmap:: Subcommands :: Entries => prepare_and_run (
161177 "repository-mailmap-entries" ,
Original file line number Diff line number Diff line change @@ -350,6 +350,11 @@ pub mod repo {
350350 #[ clap( flatten) ]
351351 args : super :: pack:: VerifyOptions ,
352352 } ,
353+ /// Describe the current commit or the given one using the name of the closest annotated tag in its ancestry.
354+ Describe {
355+ #[ clap( subcommand) ]
356+ cmd : commit:: Subcommands ,
357+ } ,
353358 /// Interact with tree objects.
354359 Tree {
355360 #[ clap( subcommand) ]
@@ -385,6 +390,33 @@ pub mod repo {
385390 }
386391 }
387392
393+ pub mod commit {
394+ #[ derive( Debug , clap:: Subcommand ) ]
395+ pub enum Subcommands {
396+ /// Describe the current commit or the given one using the name of the closest annotated tag in its ancestry.
397+ Describe {
398+ /// Use all tag references for naming, not only annotated tags.
399+ #[ clap( short = 't' , conflicts_with( "all-refs" ) ) ]
400+ all_tags : bool ,
401+
402+ /// Use all references under the `ref/` namespaces, which includes tag references, local and remote branches.
403+ #[ clap( short = 'a' , conflicts_with( "all-tags" ) ) ]
404+ all_refs : bool ,
405+
406+ /// Only follow the first parent when traversing the commit graph.
407+ #[ clap( short = 'f' ) ]
408+ first_parent : bool ,
409+
410+ #[ clap( short = 'a' ) ]
411+ /// If there was no way to describe the commit, fallback to using the abbreviated input revision.
412+ always : bool ,
413+
414+ /// A specification of the revision to use, or the current `HEAD` if unset.
415+ rev_spec : Option < String > ,
416+ } ,
417+ }
418+ }
419+
388420 pub mod tree {
389421 #[ derive( Debug , clap:: Subcommand ) ]
390422 pub enum Subcommands {
You can’t perform that action at this time.
0 commit comments