@@ -483,10 +483,12 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
483
483
484
484
if ( ! _repo . IsBare )
485
485
{
486
+ var target = GetFriendlyNameOfCommit ( commit ) ;
487
+
486
488
if ( current . Head != commit . SHA )
487
489
{
488
490
var reset = new MenuItem ( ) ;
489
- reset . Header = App . Text ( "CommitCM.Reset" , current . Name ) ;
491
+ reset . Header = App . Text ( "CommitCM.Reset" , current . Name , target ) ;
490
492
reset . Icon = App . CreateMenuIcon ( "Icons.Reset" ) ;
491
493
reset . Click += ( _ , e ) =>
492
494
{
@@ -499,7 +501,7 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
499
501
if ( commit . IsMerged )
500
502
{
501
503
var squash = new MenuItem ( ) ;
502
- squash . Header = App . Text ( "CommitCM.SquashCommitsSinceThis" ) ;
504
+ squash . Header = App . Text ( "CommitCM.SquashCommitsSinceThis" , target ) ;
503
505
squash . Icon = App . CreateMenuIcon ( "Icons.SquashIntoParent" ) ;
504
506
squash . Click += ( _ , e ) =>
505
507
{
@@ -545,7 +547,7 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
545
547
if ( ! commit . IsMerged )
546
548
{
547
549
var rebase = new MenuItem ( ) ;
548
- rebase . Header = App . Text ( "CommitCM.Rebase" , current . Name ) ;
550
+ rebase . Header = App . Text ( "CommitCM.Rebase" , current . Name , target ) ;
549
551
rebase . Icon = App . CreateMenuIcon ( "Icons.Rebase" ) ;
550
552
rebase . Click += ( _ , e ) =>
551
553
{
@@ -630,7 +632,7 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
630
632
} ;
631
633
632
634
var interactiveRebase = new MenuItem ( ) ;
633
- interactiveRebase . Header = App . Text ( "CommitCM.InteractiveRebase" , current . Name ) ;
635
+ interactiveRebase . Header = App . Text ( "CommitCM.InteractiveRebase" , current . Name , target ) ;
634
636
interactiveRebase . Icon = App . CreateMenuIcon ( "Icons.InteractiveRebase" ) ;
635
637
interactiveRebase . Click += async ( _ , e ) =>
636
638
{
@@ -871,6 +873,19 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
871
873
return menu ;
872
874
}
873
875
876
+ private static string GetFriendlyNameOfCommit ( Models . Commit commit )
877
+ {
878
+ var branchDecorator = commit . Decorators . Find ( x => x . Type is Models . DecoratorType . LocalBranchHead or Models . DecoratorType . RemoteBranchHead ) ;
879
+ if ( branchDecorator != null )
880
+ return branchDecorator . Name ;
881
+
882
+ var tagDecorator = commit . Decorators . Find ( x => x . Type is Models . DecoratorType . Tag ) ;
883
+ if ( tagDecorator != null )
884
+ return tagDecorator . Name ;
885
+
886
+ return commit . SHA [ ..10 ] ;
887
+ }
888
+
874
889
private void FillCurrentBranchMenu ( ContextMenu menu , Models . Branch current )
875
890
{
876
891
var submenu = new MenuItem ( ) ;
0 commit comments