@@ -483,10 +483,12 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
483483
484484 if ( ! _repo . IsBare )
485485 {
486+ var target = GetFriendlyNameOfCommit ( commit ) ;
487+
486488 if ( current . Head != commit . SHA )
487489 {
488490 var reset = new MenuItem ( ) ;
489- reset . Header = App . Text ( "CommitCM.Reset" , current . Name ) ;
491+ reset . Header = App . Text ( "CommitCM.Reset" , current . Name , target ) ;
490492 reset . Icon = App . CreateMenuIcon ( "Icons.Reset" ) ;
491493 reset . Click += ( _ , e ) =>
492494 {
@@ -499,7 +501,7 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
499501 if ( commit . IsMerged )
500502 {
501503 var squash = new MenuItem ( ) ;
502- squash . Header = App . Text ( "CommitCM.SquashCommitsSinceThis" ) ;
504+ squash . Header = App . Text ( "CommitCM.SquashCommitsSinceThis" , target ) ;
503505 squash . Icon = App . CreateMenuIcon ( "Icons.SquashIntoParent" ) ;
504506 squash . Click += ( _ , e ) =>
505507 {
@@ -545,7 +547,7 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
545547 if ( ! commit . IsMerged )
546548 {
547549 var rebase = new MenuItem ( ) ;
548- rebase . Header = App . Text ( "CommitCM.Rebase" , current . Name ) ;
550+ rebase . Header = App . Text ( "CommitCM.Rebase" , current . Name , target ) ;
549551 rebase . Icon = App . CreateMenuIcon ( "Icons.Rebase" ) ;
550552 rebase . Click += ( _ , e ) =>
551553 {
@@ -630,7 +632,7 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
630632 } ;
631633
632634 var interactiveRebase = new MenuItem ( ) ;
633- interactiveRebase . Header = App . Text ( "CommitCM.InteractiveRebase" , current . Name ) ;
635+ interactiveRebase . Header = App . Text ( "CommitCM.InteractiveRebase" , current . Name , target ) ;
634636 interactiveRebase . Icon = App . CreateMenuIcon ( "Icons.InteractiveRebase" ) ;
635637 interactiveRebase . Click += async ( _ , e ) =>
636638 {
@@ -871,6 +873,19 @@ public ContextMenu CreateContextMenuForSelectedCommits(List<Models.Commit> selec
871873 return menu ;
872874 }
873875
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+
874889 private void FillCurrentBranchMenu ( ContextMenu menu , Models . Branch current )
875890 {
876891 var submenu = new MenuItem ( ) ;
0 commit comments