Skip to content

Commit

Permalink
Added a dialog for failing commit hooks
Browse files Browse the repository at this point in the history
This enables the user to force a commit (i.e. --no-verify) when either pre-commit or
commit-msg hook fails.
  • Loading branch information
koraktor committed Sep 13, 2010
1 parent ed83316 commit 21d1f39
Show file tree
Hide file tree
Showing 12 changed files with 1,425 additions and 23 deletions.
10 changes: 10 additions & 0 deletions GitX.xcodeproj/project.pbxproj
Expand Up @@ -21,6 +21,8 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */; };
02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */ = {isa = PBXBuildFile; fileRef = 02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */; };
056438B70ED0C40B00985397 /* DetailViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 056438B60ED0C40B00985397 /* DetailViewTemplate.png */; };
3BC07F4C0ED5A5C5009A7768 /* HistoryViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4A0ED5A5C5009A7768 /* HistoryViewTemplate.png */; };
3BC07F4D0ED5A5C5009A7768 /* CommitViewTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 3BC07F4B0ED5A5C5009A7768 /* CommitViewTemplate.png */; };
Expand Down Expand Up @@ -237,6 +239,9 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
02B41A5C123E307200DFC531 /* PBCommitHookFailedSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitHookFailedSheet.h; sourceTree = "<group>"; };
02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitHookFailedSheet.m; sourceTree = "<group>"; };
02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PBCommitHookFailedSheet.xib; sourceTree = "<group>"; };
056438B60ED0C40B00985397 /* DetailViewTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = DetailViewTemplate.png; path = Images/DetailViewTemplate.png; sourceTree = "<group>"; };
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
Expand Down Expand Up @@ -620,6 +625,7 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
02B41A5F123E307F00DFC531 /* PBCommitHookFailedSheet.xib */,
F5F7D0641062E7940072C81C /* UpdateKey.pem */,
F50A41130EBB872D00208746 /* Widgets */,
47DBDB920E94F47200671A1E /* Preference Icons */,
Expand Down Expand Up @@ -691,6 +697,8 @@
D82F435F111B9C6D00A25A39 /* Sheets */ = {
isa = PBXGroup;
children = (
02B41A5C123E307200DFC531 /* PBCommitHookFailedSheet.h */,
02B41A5D123E307200DFC531 /* PBCommitHookFailedSheet.m */,
D854948410D5C01B0083B917 /* PBCreateBranchSheet.h */,
D854948510D5C01B0083B917 /* PBCreateBranchSheet.m */,
D8E3B34B10DCA958001096A3 /* PBCreateTagSheet.h */,
Expand Down Expand Up @@ -1172,6 +1180,7 @@
D8022FE811E124A0003C21F6 /* PBGitXMessageSheet.xib in Resources */,
D8F01C4B12182F19007F729F /* GitX.sdef in Resources */,
D8F4AB7912298CE200D6D53C /* rewindImage.pdf in Resources */,
02B41A60123E307F00DFC531 /* PBCommitHookFailedSheet.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1321,6 +1330,7 @@
D8F01D531218A164007F729F /* NSApplication+GitXScripting.m in Sources */,
D8B4DC571220D1E4004166D6 /* PBHistorySearchController.m in Sources */,
D8712A00122B14EC00012334 /* GitXTextFieldCell.m in Sources */,
02B41A5E123E307200DFC531 /* PBCommitHookFailedSheet.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
25 changes: 25 additions & 0 deletions PBCommitHookFailedSheet.h
@@ -0,0 +1,25 @@
//
// PBCommitHookFailedSheet.h
// GitX
//
// Created by Sebastian Staudt on 9/12/10.
// Copyright 2010 Sebastian Staudt. All rights reserved.
//

#import <Cocoa/Cocoa.h>

#import "PBGitCommitController.h"
#import "PBGitXMessageSheet.h"


@interface PBCommitHookFailedSheet : PBGitXMessageSheet
{
PBGitCommitController *commitController;
}

+ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info commitController:(PBGitCommitController *)controller;

- (id)initWithWindowNibName:(NSString *)windowNibName andController:(PBGitCommitController *)controller;
- (IBAction)forceCommit:(id)sender;

@end
38 changes: 38 additions & 0 deletions PBCommitHookFailedSheet.m
@@ -0,0 +1,38 @@
//
// PBCommitHookFailedSheet.m
// GitX
//
// Created by Sebastian Staudt on 9/12/10.
// Copyright 2010 Sebastian Staudt. All rights reserved.
//

#import "PBCommitHookFailedSheet.h"
#import "PBGitWindowController.h"


@implementation PBCommitHookFailedSheet

#pragma mark -
#pragma mark PBCommitHookFailedSheet

+ (void)beginMessageSheetForWindow:(NSWindow *)parentWindow withMessageText:(NSString *)message infoText:(NSString *)info commitController:(PBGitCommitController *)controller
{
PBCommitHookFailedSheet *sheet = [[self alloc] initWithWindowNibName:@"PBCommitHookFailedSheet" andController:controller];
[sheet beginMessageSheetForWindow:parentWindow withMessageText:message infoText:info];
}

- (id)initWithWindowNibName:(NSString *)windowNibName andController:(PBGitCommitController *)controller;
{
self = [self initWithWindowNibName:windowNibName];
commitController = controller;

return self;
}

- (IBAction)forceCommit:(id)sender
{
[self closeMessageSheet:self];
[commitController forceCommit:sender];
}

@end

0 comments on commit 21d1f39

Please sign in to comment.