@@ -17,7 +17,7 @@ pub(crate) fn commit_graph(repo_path: &Path, json: bool, short: bool) -> anyhow:
17
17
but_rules:: process_rules ( ctx) . ok ( ) ; // TODO: this is doing double work (dependencies can be reused)
18
18
let stacks = stacks ( ctx) ?
19
19
. iter ( )
20
- . filter_map ( |s| s. id . map ( |id| stack_details ( ctx, id) ) )
20
+ . filter_map ( |s| s. id . map ( |id| stack_details ( ctx, id) . map ( |d| ( id , d ) ) ) )
21
21
. filter_map ( Result :: ok)
22
22
. collect :: < Vec < _ > > ( ) ;
23
23
@@ -30,7 +30,13 @@ pub(crate) fn commit_graph(repo_path: &Path, json: bool, short: bool) -> anyhow:
30
30
}
31
31
32
32
let mut nesting = 0 ;
33
- for ( i, stack) in stacks. iter ( ) . enumerate ( ) {
33
+ for ( i, ( stack_id, stack) ) in stacks. iter ( ) . enumerate ( ) {
34
+ let marked = crate :: mark:: stack_marked ( ctx, * stack_id) . unwrap_or_default ( ) ;
35
+ let mut mark = if marked {
36
+ Some ( "◀ Marked ▶" . red ( ) . bold ( ) )
37
+ } else {
38
+ None
39
+ } ;
34
40
let mut second_consecutive = false ;
35
41
let mut stacked = false ;
36
42
for branch in stack. branch_details . iter ( ) {
@@ -54,13 +60,15 @@ pub(crate) fn commit_graph(repo_path: &Path, json: bool, short: bool) -> anyhow:
54
60
. underline ( )
55
61
. blue ( ) ;
56
62
println ! (
57
- "{}{}{} [{}] {}" ,
63
+ "{}{}{} [{}] {} {} " ,
58
64
"│ " . repeat( nesting) ,
59
65
extra_space,
60
66
line,
61
67
branch. name. to_string( ) . green( ) . bold( ) ,
62
- id
68
+ id,
69
+ mark. clone( ) . unwrap_or_default( )
63
70
) ;
71
+ mark = None ; // show this on the first branch in the stack
64
72
for ( j, commit) in branch. upstream_commits . iter ( ) . enumerate ( ) {
65
73
let time_string = chrono:: DateTime :: from_timestamp_millis ( commit. created_at as i64 )
66
74
. ok_or ( anyhow:: anyhow!( "Could not parse timestamp" ) ) ?
0 commit comments