Skip to content

Commit

Permalink
Merge branch 'pu/pb/index_refactor'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
pieter committed Sep 17, 2009
2 parents 1a5a211 + a2b3bf3 commit 1854fc0
Show file tree
Hide file tree
Showing 11 changed files with 912 additions and 636 deletions.
18 changes: 16 additions & 2 deletions GitX.xcodeproj/project.pbxproj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */; }; F59116E90E843BCB0072CCB1 /* PBGitCommitController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59116E80E843BCB0072CCB1 /* PBGitCommitController.m */; };
F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; }; F593DF780E9E636C003A8559 /* PBFileChangesTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */; };
F5945E170E02B0C200706420 /* PBGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = F5945E160E02B0C200706420 /* PBGitRepository.m */; }; F5945E170E02B0C200706420 /* PBGitRepository.m in Sources */ = {isa = PBXBuildFile; fileRef = F5945E160E02B0C200706420 /* PBGitRepository.m */; };
F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = F59F1DD4105C4FF300115F88 /* PBGitIndex.m */; };
F5AD56790E79B78100EDAAFE /* PBCommitList.m in Sources */ = {isa = PBXBuildFile; fileRef = F5AD56780E79B78100EDAAFE /* PBCommitList.m */; }; F5AD56790E79B78100EDAAFE /* PBCommitList.m in Sources */ = {isa = PBXBuildFile; fileRef = F5AD56780E79B78100EDAAFE /* PBCommitList.m */; };
F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5B721C20E05CF7E00AF29DC /* MainMenu.xib */; }; F5B721C40E05CF7E00AF29DC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F5B721C20E05CF7E00AF29DC /* MainMenu.xib */; };
F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C007740E731B48007B84B2 /* PBGitRef.m */; }; F5C007750E731B48007B84B2 /* PBGitRef.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C007740E731B48007B84B2 /* PBGitRef.m */; };
Expand Down Expand Up @@ -250,6 +251,8 @@
F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBFileChangesTableView.m; sourceTree = "<group>"; }; F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBFileChangesTableView.m; sourceTree = "<group>"; };
F5945E150E02B0C200706420 /* PBGitRepository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRepository.h; sourceTree = "<group>"; }; F5945E150E02B0C200706420 /* PBGitRepository.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitRepository.h; sourceTree = "<group>"; };
F5945E160E02B0C200706420 /* PBGitRepository.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRepository.m; sourceTree = "<group>"; }; F5945E160E02B0C200706420 /* PBGitRepository.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitRepository.m; sourceTree = "<group>"; };
F59F1DD3105C4FF300115F88 /* PBGitIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBGitIndex.h; sourceTree = "<group>"; };
F59F1DD4105C4FF300115F88 /* PBGitIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBGitIndex.m; sourceTree = "<group>"; };
F5AD56770E79B78100EDAAFE /* PBCommitList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitList.h; sourceTree = "<group>"; }; F5AD56770E79B78100EDAAFE /* PBCommitList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCommitList.h; sourceTree = "<group>"; };
F5AD56780E79B78100EDAAFE /* PBCommitList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitList.m; sourceTree = "<group>"; }; F5AD56780E79B78100EDAAFE /* PBCommitList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCommitList.m; sourceTree = "<group>"; };
F5B721C30E05CF7E00AF29DC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; }; F5B721C30E05CF7E00AF29DC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -467,6 +470,7 @@
F56174540E05887E001DCD79 /* Git */ = { F56174540E05887E001DCD79 /* Git */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
F59F1DD2105C4FDE00115F88 /* Index */,
F5E927E30E883D6800056E75 /* Commit */, F5E927E30E883D6800056E75 /* Commit */,
F5E927E10E883D2E00056E75 /* History */, F5E927E10E883D2E00056E75 /* History */,
F5945E150E02B0C200706420 /* PBGitRepository.h */, F5945E150E02B0C200706420 /* PBGitRepository.h */,
Expand Down Expand Up @@ -549,6 +553,17 @@
name = SpeedTest; name = SpeedTest;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
F59F1DD2105C4FDE00115F88 /* Index */ = {
isa = PBXGroup;
children = (
F5E927F60E883E7200056E75 /* PBChangedFile.h */,
F5E927F70E883E7200056E75 /* PBChangedFile.m */,
F59F1DD3105C4FF300115F88 /* PBGitIndex.h */,
F59F1DD4105C4FF300115F88 /* PBGitIndex.m */,
);
name = Index;
sourceTree = "<group>";
};
F5B161BB0EAB6E0C005A1DE1 /* Diff */ = { F5B161BB0EAB6E0C005A1DE1 /* Diff */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
Expand Down Expand Up @@ -604,8 +619,6 @@
children = ( children = (
93F7857D0EA3ABF100C1F443 /* PBCommitMessageView.h */, 93F7857D0EA3ABF100C1F443 /* PBCommitMessageView.h */,
93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */, 93F7857E0EA3ABF100C1F443 /* PBCommitMessageView.m */,
F5E927F60E883E7200056E75 /* PBChangedFile.h */,
F5E927F70E883E7200056E75 /* PBChangedFile.m */,
F593DF760E9E636C003A8559 /* PBFileChangesTableView.h */, F593DF760E9E636C003A8559 /* PBFileChangesTableView.h */,
F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */, F593DF770E9E636C003A8559 /* PBFileChangesTableView.m */,
); );
Expand Down Expand Up @@ -854,6 +867,7 @@
47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */, 47DBDBCA0E95016F00671A1E /* PBNSURLPathUserDefaultsTransfomer.m in Sources */,
F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */, F562C8870FE1766C000EC528 /* NSString_RegEx.m in Sources */,
EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */, EB2A734A0FEE3F09006601CF /* PBCollapsibleSplitView.m in Sources */,
F59F1DD5105C4FF300115F88 /* PBGitIndex.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
Expand Down
32 changes: 8 additions & 24 deletions PBGitCommitController.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "PBViewController.h" #import "PBViewController.h"


@class PBGitIndexController; @class PBGitIndexController, PBIconAndTextCell, PBWebChangesController, PBGitIndex;
@class PBIconAndTextCell;
@class PBWebChangesController;


@interface PBGitCommitController : PBViewController { @interface PBGitCommitController : PBViewController {
NSMutableArray *files; // This might have to transfer over to the PBGitRepository
// object sometime
PBGitIndex *index;


IBOutlet NSTextView *commitMessageView; IBOutlet NSTextView *commitMessageView;
IBOutlet NSArrayController *unstagedFilesController; IBOutlet NSArrayController *unstagedFilesController;
Expand All @@ -24,28 +24,12 @@
IBOutlet PBWebChangesController *webController; IBOutlet PBWebChangesController *webController;


NSString *status; NSString *status;

BOOL busy;
// We use busy as a count of active processes.
// You can increase it when your process start
// And decrease it after you have finished.
int busy;
BOOL amend;
NSDictionary *amendEnvironment;

} }


@property (retain) NSMutableArray *files; @property(copy) NSString *status;
@property (copy) NSString *status; @property(readonly) PBGitIndex *index;
@property (assign) int busy; @property(assign) BOOL busy;
@property (assign) BOOL amend;

- (void) readCachedFiles:(NSNotification *)notification;
- (void) readOtherFiles:(NSNotification *)notification;
- (void) readUnstagedFiles:(NSNotification *)notification;
- (void) stageHunk: (NSString *)hunk reverse:(BOOL)reverse;
- (void)discardHunk:(NSString *)hunk;

- (NSString *)parentTree;


- (IBAction) refresh:(id) sender; - (IBAction) refresh:(id) sender;
- (IBAction) commit:(id) sender; - (IBAction) commit:(id) sender;
Expand Down
Loading

0 comments on commit 1854fc0

Please sign in to comment.