mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 13:51:53 +08:00
Merge pull request #282 from RevenantX/copy_commit_info
Add copy info that copies "{Short SHA} - {commit subject}" into clipboard
This commit is contained in:
@@ -97,6 +97,7 @@
|
||||
<x:String x:Key="Text.CommitCM.CompareWithHead" xml:space="preserve">Compare with HEAD</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CompareWithWorktree" xml:space="preserve">Compare with Worktree</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopySHA" xml:space="preserve">Copy SHA</x:String>
|
||||
<x:String x:Key="Text.CommitCM.CopyInfo" xml:space="preserve">Copy Info</x:String>
|
||||
<x:String x:Key="Text.CommitCM.InteractiveRebase" xml:space="preserve">Interactive Rebase ${0}$ to Here</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Rebase" xml:space="preserve">Rebase ${0}$ to Here</x:String>
|
||||
<x:String x:Key="Text.CommitCM.Reset" xml:space="preserve">Reset ${0}$ to Here</x:String>
|
||||
|
||||
@@ -435,6 +435,17 @@ namespace SourceGit.ViewModels
|
||||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(copySHA);
|
||||
|
||||
var copyInfo = new MenuItem();
|
||||
copyInfo.Header = App.Text("CommitCM.CopyInfo");
|
||||
copyInfo.Icon = App.CreateMenuIcon("Icons.Copy");
|
||||
copyInfo.Click += (_, e) =>
|
||||
{
|
||||
App.CopyText($"{commit.SHA[..7]} - {commit.Subject}");
|
||||
e.Handled = true;
|
||||
};
|
||||
menu.Items.Add(copyInfo);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user