mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Add "Copy SHA" alternate menu item to main menu, with default binding Cmd-Option-C. It copies just the leading 7 characters of the SHA instead of the whole commit info.
This commit is contained in:
committed by
Nathan Kinsinger
parent
caa6ed01f9
commit
d4cb11bb8b
+1075
-157
File diff suppressed because it is too large
Load Diff
@@ -51,6 +51,11 @@
|
||||
[controller copyCommitInfo];
|
||||
}
|
||||
|
||||
- (void) copySHA:(id)sender
|
||||
{
|
||||
[controller copyCommitSHA];
|
||||
}
|
||||
|
||||
// !!! Andre Berg 20100330: Used from -scrollSelectionToTopOfViewFrom: of PBGitHistoryController
|
||||
// so that when the history controller udpates the branch filter the origin of the superview gets
|
||||
// shifted into multiples of the row height. Otherwise the top selected row will always be off by
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
- (IBAction) rebase:(id)sender;
|
||||
|
||||
- (void) copyCommitInfo;
|
||||
- (void) copyCommitSHA;
|
||||
|
||||
- (BOOL) hasNonlinearPath;
|
||||
|
||||
|
||||
@@ -304,6 +304,19 @@
|
||||
|
||||
}
|
||||
|
||||
- (void) copyCommitSHA
|
||||
{
|
||||
PBGitCommit *commit = [[commitController selectedObjects] objectAtIndex:0];
|
||||
if (!commit)
|
||||
return;
|
||||
NSString *info = [[commit realSha] substringWithRange:NSMakeRange(0, 7)];
|
||||
|
||||
NSPasteboard *a =[NSPasteboard generalPasteboard];
|
||||
[a declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self];
|
||||
[a setString:info forType: NSStringPboardType];
|
||||
|
||||
}
|
||||
|
||||
- (IBAction) toggleQLPreviewPanel:(id)sender
|
||||
{
|
||||
if ([[QLPreviewPanel sharedPreviewPanel] respondsToSelector:@selector(setDataSource:)]) {
|
||||
|
||||
Reference in New Issue
Block a user