@@ -51,6 +51,11 @@ pub struct Args {
51
51
52
52
#[ derive( Debug , clap:: Subcommand ) ]
53
53
pub enum Subcommands {
54
+ /// Interact with commit objects.
55
+ Commit {
56
+ #[ clap( subcommand) ]
57
+ cmd : commit:: Subcommands ,
58
+ } ,
54
59
/// Verify the integrity of the entire repository
55
60
Verify {
56
61
#[ clap( flatten) ]
@@ -68,6 +73,45 @@ pub enum Subcommands {
68
73
Free ( free:: Subcommands ) ,
69
74
}
70
75
76
+ pub mod commit {
77
+ #[ derive( Debug , clap:: Subcommand ) ]
78
+ pub enum Subcommands {
79
+ /// Describe the current commit or the given one using the name of the closest annotated tag in its ancestry.
80
+ Describe {
81
+ /// Use annotated tag references only, not all tags.
82
+ #[ clap( long, short = 't' , conflicts_with( "all-refs" ) ) ]
83
+ annotated_tags : bool ,
84
+
85
+ /// Use all references under the `ref/` namespaces, which includes tag references, local and remote branches.
86
+ #[ clap( long, short = 'a' , conflicts_with( "annotated-tags" ) ) ]
87
+ all_refs : bool ,
88
+
89
+ /// Only follow the first parent when traversing the commit graph.
90
+ #[ clap( long, short = 'f' ) ]
91
+ first_parent : bool ,
92
+
93
+ /// Always display the long format, even if that would not be necessary as the id is located directly on a reference.
94
+ #[ clap( long, short = 'l' ) ]
95
+ long : bool ,
96
+
97
+ /// Consider only the given `n` candidates. This can take longer, but potentially produces more accurate results.
98
+ #[ clap( long, short = 'c' , default_value = "10" ) ]
99
+ max_candidates : usize ,
100
+
101
+ /// Print information on stderr to inform about performance statistics
102
+ #[ clap( long, short = 's' ) ]
103
+ statistics : bool ,
104
+
105
+ #[ clap( long) ]
106
+ /// If there was no way to describe the commit, fallback to using the abbreviated input revision.
107
+ always : bool ,
108
+
109
+ /// A specification of the revision to use, or the current `HEAD` if unset.
110
+ rev_spec : Option < String > ,
111
+ } ,
112
+ }
113
+ }
114
+
71
115
pub mod revision {
72
116
#[ derive( Debug , clap:: Subcommand ) ]
73
117
#[ clap( visible_alias = "rev" ) ]
@@ -488,11 +532,6 @@ pub mod repo {
488
532
#[ derive( Debug , clap:: Subcommand ) ]
489
533
#[ clap( visible_alias = "repo" ) ]
490
534
pub enum Subcommands {
491
- /// Interact with commit objects.
492
- Commit {
493
- #[ clap( subcommand) ]
494
- cmd : commit:: Subcommands ,
495
- } ,
496
535
/// Interact with tree objects.
497
536
Tree {
498
537
#[ clap( subcommand) ]
@@ -559,45 +598,6 @@ pub mod repo {
559
598
}
560
599
}
561
600
562
- pub mod commit {
563
- #[ derive( Debug , clap:: Subcommand ) ]
564
- pub enum Subcommands {
565
- /// Describe the current commit or the given one using the name of the closest annotated tag in its ancestry.
566
- Describe {
567
- /// Use annotated tag references only, not all tags.
568
- #[ clap( long, short = 't' , conflicts_with( "all-refs" ) ) ]
569
- annotated_tags : bool ,
570
-
571
- /// Use all references under the `ref/` namespaces, which includes tag references, local and remote branches.
572
- #[ clap( long, short = 'a' , conflicts_with( "annotated-tags" ) ) ]
573
- all_refs : bool ,
574
-
575
- /// Only follow the first parent when traversing the commit graph.
576
- #[ clap( long, short = 'f' ) ]
577
- first_parent : bool ,
578
-
579
- /// Always display the long format, even if that would not be necessary as the id is located directly on a reference.
580
- #[ clap( long, short = 'l' ) ]
581
- long : bool ,
582
-
583
- /// Consider only the given `n` candidates. This can take longer, but potentially produces more accurate results.
584
- #[ clap( long, short = 'c' , default_value = "10" ) ]
585
- max_candidates : usize ,
586
-
587
- /// Print information on stderr to inform about performance statistics
588
- #[ clap( long, short = 's' ) ]
589
- statistics : bool ,
590
-
591
- #[ clap( long) ]
592
- /// If there was no way to describe the commit, fallback to using the abbreviated input revision.
593
- always : bool ,
594
-
595
- /// A specification of the revision to use, or the current `HEAD` if unset.
596
- rev_spec : Option < String > ,
597
- } ,
598
- }
599
- }
600
-
601
601
pub mod tree {
602
602
#[ derive( Debug , clap:: Subcommand ) ]
603
603
pub enum Subcommands {
0 commit comments