Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dbd4ab8
Change inconsistent "SHA" uses to "OID"
tiennou Jul 12, 2014
86b0019
Just use the ref's OID directly.
tiennou Jul 12, 2014
56cd7a6
Use URLs for locating the working directory.
tiennou Jul 15, 2014
37db497
Private ivars go in class extensions.
tiennou Jul 15, 2014
af1c4b5
Property-fy PBGitIndex.
tiennou Jul 15, 2014
e05a628
Move some common actions up in the responder chain.
tiennou Jul 15, 2014
65ebec8
Show HEAD in the sidebar if it's detached
tiennou Feb 13, 2015
73cf163
added stashes property to PBGitRepository.
muhqu Aug 1, 2013
86801cf
add Stashes list to Sidebar.
muhqu Aug 1, 2013
5e950cb
keep stashes in sidebar updated when repository changes
muhqu Aug 6, 2013
650fbd9
wire-up stash actions: pop, apply, drop
muhqu Aug 6, 2013
3fdc4a3
added "Stash Changes" button and "Keep Index" checkbox to Commit View.
muhqu Aug 7, 2013
297d345
wire-up stash save, with keep index option
muhqu Aug 7, 2013
9d0767e
make "Stash Changes" button inactive if working copy is clean.
muhqu Aug 7, 2013
4402136
out-comment too verbose logging
muhqu Aug 11, 2013
3b38652
added App Menu items under "Repository"
muhqu Aug 11, 2013
88442a1
improve keyboard navigation in commit dialog
muhqu Aug 7, 2013
8e0615a
quick and dirty show stash error messages via showErrorSheet
muhqu Aug 21, 2013
381cc3d
Missing initialization
tiennou Feb 13, 2015
ba99cf3
Cosmetics
tiennou Feb 13, 2015
8440a3b
Silence the analyzer
tiennou Feb 13, 2015
1aa7aae
Prevents refs/stash from being deleted
tiennou Feb 13, 2015
90a07b1
Workaround because the commit controller isn't part of the responder …
tiennou Feb 13, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added "Stash Changes" button and "Keep Index" checkbox to Commit View.
Therefore the old controls, e.g. "Amend" checkbox, "Sign-off" and "Commit" buttons, have been moved into a tab-less NSTabView. The tab switches to the stash controls when holding the Alt-Key down.
  • Loading branch information
muhqu authored and tiennou committed Feb 13, 2015
commit 3fdc4a39cd4087f054cf380471d57383cbfafee2
9 changes: 8 additions & 1 deletion Classes/Controllers/PBGitCommitController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
PBGitIndex *index;

IBOutlet PBCommitMessageView *commitMessageView;

BOOL stashKeepIndex;

IBOutlet NSArrayController *unstagedFilesController;
IBOutlet NSArrayController *cachedFilesController;

IBOutlet NSTabView *controlsTabView;
IBOutlet NSButton *commitButton;

IBOutlet PBGitIndexController *indexController;
Expand All @@ -32,9 +37,11 @@
}

@property(readonly) PBGitIndex *index;
@property(assign) BOOL stashKeepIndex;

- (IBAction) refresh:(id) sender;
- (IBAction) commit:(id) sender;
- (IBAction) forceCommit:(id) sender;
- (IBAction)signOff:(id)sender;
- (IBAction) signOff:(id)sender;
- (IBAction) stashChanges:(id) sender;
@end
24 changes: 24 additions & 0 deletions Classes/Controllers/PBGitCommitController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#import <ObjectiveGit/GTConfiguration.h>

#define kCommitSplitViewPositionDefault @"Commit SplitView Position"
#define kControlsTabIndexCommit 0
#define kControlsTabIndexStash 1

@interface PBGitCommitController ()
- (void)refreshFinished:(NSNotification *)notification;
Expand All @@ -36,6 +38,7 @@ - (void)saveCommitSplitViewPosition;
@implementation PBGitCommitController

@synthesize index;
@synthesize stashKeepIndex;

- (id)initWithRepository:(PBGitRepository *)theRepository superController:(PBGitWindowController *)controller
{
Expand Down Expand Up @@ -126,6 +129,8 @@ - (IBAction)signOff:(id)sender

- (void) refresh:(id) sender
{
[controlsTabView selectTabViewItemAtIndex:kControlsTabIndexCommit];

self.isBusy = YES;
self.status = @"Refreshing index…";
[index refresh];
Expand All @@ -139,6 +144,11 @@ - (void) updateView
[self refresh:nil];
}

- (IBAction) stashChanges:(id)sender
{
NSLog(@"stash changes: %@", stashKeepIndex ? @"keep index" : @"");
}

- (IBAction) commit:(id) sender
{
[self commitWithVerification:YES];
Expand Down Expand Up @@ -316,4 +326,18 @@ - (void)restoreCommitSplitViewPositiion
[commitSplitView setHidden:NO];
}

#pragma mark Handle "alt" key-down/up events
// to toggle commit/stash controls

- (void)flagsChanged:(NSEvent *)theEvent
{
BOOL altDown = !!([theEvent modifierFlags] & NSAlternateKeyMask);
int currIndex = [controlsTabView indexOfTabViewItem:controlsTabView.selectedTabViewItem];
int desiredIndex = altDown ? kControlsTabIndexStash : kControlsTabIndexCommit;
if (currIndex != desiredIndex) {
[controlsTabView selectTabViewItemAtIndex:desiredIndex];
}
}


@end
Loading