@@ -17,7 +17,7 @@ pub(crate) fn commit_graph(repo_path: &Path, json: bool, short: bool) -> anyhow:
1717 but_rules:: process_rules ( ctx) . ok ( ) ; // TODO: this is doing double work (dependencies can be reused)
1818 let stacks = stacks ( ctx) ?
1919 . 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 ) ) ) )
2121 . filter_map ( Result :: ok)
2222 . collect :: < Vec < _ > > ( ) ;
2323
@@ -30,7 +30,13 @@ pub(crate) fn commit_graph(repo_path: &Path, json: bool, short: bool) -> anyhow:
3030 }
3131
3232 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+ } ;
3440 let mut second_consecutive = false ;
3541 let mut stacked = false ;
3642 for branch in stack. branch_details . iter ( ) {
@@ -54,13 +60,15 @@ pub(crate) fn commit_graph(repo_path: &Path, json: bool, short: bool) -> anyhow:
5460 . underline ( )
5561 . blue ( ) ;
5662 println ! (
57- "{}{}{} [{}] {}" ,
63+ "{}{}{} [{}] {} {} " ,
5864 "│ " . repeat( nesting) ,
5965 extra_space,
6066 line,
6167 branch. name. to_string( ) . green( ) . bold( ) ,
62- id
68+ id,
69+ mark. clone( ) . unwrap_or_default( )
6370 ) ;
71+ mark = None ; // show this on the first branch in the stack
6472 for ( j, commit) in branch. upstream_commits . iter ( ) . enumerate ( ) {
6573 let time_string = chrono:: DateTime :: from_timestamp_millis ( commit. created_at as i64 )
6674 . ok_or ( anyhow:: anyhow!( "Could not parse timestamp" ) ) ?
0 commit comments