Skip to content

Commit 1854fc0

Browse files
committed
Merge branch 'pu/pb/index_refactor'
* pu/pb/index_refactor: (24 commits) PBGitIndex: post notifications when index stuff fails GitIndexController: reorder methods a bit, remove unnecessary stuff PBGitIndex: Migrate discardChanges to the GitIndex CommitController: Make commit message editable after commit failed GitIndex: Fix a few comments GitIndex: explicitly tell when stuff is updated Remove cruft Show previous commit message when amending CommitController: Empty commit title when commit is successful CommitView: Remove cruft Add failed commit notifications GitIndex: add commit notifications CommitController: Add status messages for index operations GitIndex: Add a few notifications CommitView: Migrate patch apply stuff to GitIndex GitIndex: Add support for applying patches CommitController: Replace commit method with the one from GitIndex GitIndex: add basic commit method GitIndexController: Migrate stageFiles functions to GitIndex GitIndex: Add methods to stage and unstage files ... Conflicts: PBGitCommitController.m PBGitIndexController.h PBGitIndexController.m
2 parents 1a5a211 + a2b3bf3 commit 1854fc0

11 files changed

+912
-636
lines changed

GitX.xcodeproj/project.pbxproj

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */; };
9898
F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; };
9999
F5945E170E02B0C200706420 /* PBGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = F5945E160E02B0C200706420 /* PBGitRepository.m */; };
100+
F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = F59F1DD4105C4FF300115F88 /* PBGitIndex.m */; };
100101
F5AD56790E79B78100EDAAFE /* PBCommitList.m in Sources */ = {isa = PBXBuildFile; fileRef = F5AD56780E79B78100EDAAFE /* PBCommitList.m */; };
101102
F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5B721C20E05CF7E00AF29DC /* MainMenu.xib */; };
102103
F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C007740E731B48007B84B2 /* PBGitRef.m */; };
@@ -250,6 +251,8 @@
250251
F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBFileChangesTableView.m; sourceTree = "<group>"; };
251252
F5945E150E02B0C200706420 /* PBGitRepository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRepository.h; sourceTree = "<group>"; };
252253
F5945E160E02B0C200706420 /* PBGitRepository.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRepository.m; sourceTree = "<group>"; };
254+
F59F1DD3105C4FF300115F88 /* PBGitIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitIndex.h; sourceTree = "<group>"; };
255+
F59F1DD4105C4FF300115F88 /* PBGitIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitIndex.m; sourceTree = "<group>"; };
253256
F5AD56770E79B78100EDAAFE /* PBCommitList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitList.h; sourceTree = "<group>"; };
254257
F5AD56780E79B78100EDAAFE /* PBCommitList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitList.m; sourceTree = "<group>"; };
255258
F5B721C30E05CF7E00AF29DC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -467,6 +470,7 @@
467470
F56174540E05887E001DCD79 /* Git */ = {
468471
isa = PBXGroup;
469472
children = (
473+
F59F1DD2105C4FDE00115F88 /* Index */,
470474
F5E927E30E883D6800056E75 /* Commit */,
471475
F5E927E10E883D2E00056E75 /* History */,
472476
F5945E150E02B0C200706420 /* PBGitRepository.h */,
@@ -549,6 +553,17 @@
549553
name = SpeedTest;
550554
sourceTree = "<group>";
551555
};
556+
F59F1DD2105C4FDE00115F88 /* Index */ = {
557+
isa = PBXGroup;
558+
children = (
559+
F5E927F60E883E7200056E75 /* PBChangedFile.h */,
560+
F5E927F70E883E7200056E75 /* PBChangedFile.m */,
561+
F59F1DD3105C4FF300115F88 /* PBGitIndex.h */,
562+
F59F1DD4105C4FF300115F88 /* PBGitIndex.m */,
563+
);
564+
name = Index;
565+
sourceTree = "<group>";
566+
};
552567
F5B161BB0EAB6E0C005A1DE1 /* Diff */ = {
553568
isa = PBXGroup;
554569
children = (
@@ -604,8 +619,6 @@
604619
children = (
605620
93F7857D0EA3ABF100C1F443 /* PBCommitMessageView.h */,
606621
93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */,
607-
F5E927F60E883E7200056E75 /* PBChangedFile.h */,
608-
F5E927F70E883E7200056E75 /* PBChangedFile.m */,
609622
F593DF760E9E636C003A8559 /* PBFileChangesTableView.h */,
610623
F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */,
611624
);
@@ -854,6 +867,7 @@
854867
47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */,
855868
F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */,
856869
EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */,
870+
F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */,
857871
);
858872
runOnlyForDeploymentPostprocessing = 0;
859873
};

PBGitCommitController.h

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#import <Cocoa/Cocoa.h>
1010
#import "PBViewController.h"
1111

12-
@class PBGitIndexController;
13-
@class PBIconAndTextCell;
14-
@class PBWebChangesController;
12+
@class PBGitIndexController, PBIconAndTextCell, PBWebChangesController, PBGitIndex;
1513

1614
@interface PBGitCommitController : PBViewController {
17-
NSMutableArray *files;
15+
// This might have to transfer over to the PBGitRepository
16+
// object sometime
17+
PBGitIndex *index;
1818

1919
IBOutlet NSTextView *commitMessageView;
2020
IBOutlet NSArrayController *unstagedFilesController;
@@ -24,28 +24,12 @@
2424
IBOutlet PBWebChangesController *webController;
2525

2626
NSString *status;
27-
28-
// We use busy as a count of active processes.
29-
// You can increase it when your process start
30-
// And decrease it after you have finished.
31-
int busy;
32-
BOOL amend;
33-
NSDictionary *amendEnvironment;
34-
27+
BOOL busy;
3528
}
3629

37-
@property (retain) NSMutableArray *files;
38-
@property (copy) NSString *status;
39-
@property (assign) int busy;
40-
@property (assign) BOOL amend;
41-
42-
- (void) readCachedFiles:(NSNotification *)notification;
43-
- (void) readOtherFiles:(NSNotification *)notification;
44-
- (void) readUnstagedFiles:(NSNotification *)notification;
45-
- (void) stageHunk: (NSString *)hunk reverse:(BOOL)reverse;
46-
- (void)discardHunk:(NSString *)hunk;
47-
48-
- (NSString *)parentTree;
30+
@property(copy) NSString *status;
31+
@property(readonly) PBGitIndex *index;
32+
@property(assign) BOOL busy;
4933

5034
- (IBAction) refresh:(id) sender;
5135
- (IBAction) commit:(id) sender;

0 commit comments

Comments
 (0)