@@ -4,12 +4,20 @@ use clap::Parser;
4
4
use ezcmd:: EasyCommand ;
5
5
use git_glimpse:: { git_config, list_branches_cmd, run, show_graph, stdout_lines} ;
6
6
7
- /// Show a minimal graph of Git commits.
7
+ /// Show a minimal graph of Git commits for various use cases .
8
8
///
9
- /// When no arguments are specified, this commands runs as if the `stack` subcommand was invoked
9
+ /// When no arguments are specified, this commands runs as if the `stack` command was invoked
10
10
/// with no arguments.
11
+ ///
12
+ /// This binary has two optional points of Git configuration:
13
+ ///
14
+ /// * `glimpse.base`: Sets the mainline branch. It is recommended that you use this only if
15
+ /// this command does not correctly detect your mainline branch out-of-the-box.
16
+ ///
17
+ /// * `glimpse.pretty`: The fallback value for the `--format` argument of this command.
11
18
#[ derive( Debug , Parser ) ]
12
19
struct Args {
20
+ /// Set the `--pretty` argument for underlying Git CLI calls.
13
21
#[ clap( long, short) ]
14
22
format : Option < String > ,
15
23
#[ clap( subcommand) ]
@@ -18,6 +26,11 @@ struct Args {
18
26
19
27
#[ derive( Debug , Parser ) ]
20
28
enum Subcommand {
29
+ /// Select the current "stack" of commits.
30
+ ///
31
+ /// A "stack" selection in this context includes the currently checked out branch and mainline
32
+ /// branch. This is useful for day-to-day work, where you want only the commits relevant to
33
+ /// what you're currently working on.
21
34
Stack {
22
35
#[ clap( long, short) ]
23
36
base : Option < String > ,
@@ -26,13 +39,22 @@ enum Subcommand {
26
39
#[ clap( flatten) ]
27
40
files : FileSelection ,
28
41
} ,
29
- /// Display local branches and, optionally, their upstreams.
42
+ /// Select all local Git branches.
43
+ ///
44
+ /// During typical work using Git, you may have several different "stacks" of work (see also
45
+ /// the `stack` command). These tend to correspond to locally checked out branches. This
46
+ /// command is useful for viewing all of them at the same time.
47
+ ///
48
+ /// If the set of branches you'd like to work with is significantly smaller than this set of
49
+ /// branches, this command might be too noisy for you. You may want to consider using a Git
50
+ /// alias for a `select` command invocation instead.
30
51
Locals {
31
52
#[ clap( flatten) ]
32
53
config : PresetConfig ,
33
54
#[ clap( flatten) ]
34
55
files : FileSelection ,
35
56
} ,
57
+ /// Select a custom set of commit-ish refs.
36
58
Select {
37
59
/// Additional branches to include.
38
60
branches : Vec < String > ,
@@ -43,13 +65,13 @@ enum Subcommand {
43
65
44
66
#[ derive( Debug , Parser ) ]
45
67
struct PresetConfig {
46
- /// Include all `@{upstream}` counterparts.
68
+ /// Also include all `@{upstream}` counterparts to selected branches .
47
69
#[ clap( long = "upstreams" , short = 'u' ) ]
48
70
select_upstreams : bool ,
49
- /// Include all `@{push}` counterparts.
71
+ /// Also select all `@{push}` counterparts to selected branches .
50
72
#[ clap( long = "pushes" , short = 'p' ) ]
51
73
select_pushes : bool ,
52
- /// Include the last tag that contains `HEAD`.
74
+ /// Also select the last tag that contains `HEAD`.
53
75
#[ clap( long = "last-tag" ) ]
54
76
select_last_tag : bool ,
55
77
}
0 commit comments