Skip to content

Commit d54dca4

Browse files
committed
Remove debugging NSLog clutter and other left-over code.
1 parent d1474bd commit d54dca4

5 files changed

+22
-79
lines changed

ApplicationController.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification
121121
self.cliArgs = [NSString stringWithUTF8String:(cliargs)];
122122
}
123123

124-
NSLog(@"[%@ %s] launchedFromGitx = %@", [self class], _cmd, (launchedFromGitx ? @"YES" : @"NO"));
125-
NSLog(@"[%@ %s] cliArgs = %@", [self class], _cmd, cliArgs);
124+
// NSLog(@"[%@ %s] launchedFromGitx = %@", [self class], _cmd, (launchedFromGitx ? @"YES" : @"NO"));
125+
// NSLog(@"[%@ %s] cliArgs = %@", [self class], _cmd, cliArgs);
126126

127127
[self registerServices];
128128

@@ -219,7 +219,7 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification
219219
- (void) finalizeCLILaunch:(id)object {
220220
for (PBGitRepository * document in launchedDocuments) {
221221
BOOL success = [[[(PBGitRepository *)document windowController] historyController] selectCommit:self.deferredSelectSha];
222-
NSLog(@"[%@ %s] trying to select commit with sha %@ (success = %@)", [self class], _cmd, self.deferredSelectSha, BMStringFromBOOL(success));
222+
// NSLog(@"[%@ %s] trying to select commit with sha %@ (success = %@)", [self class], _cmd, self.deferredSelectSha, BMStringFromBOOL(success));
223223
if (success) {
224224
PBGitWindowController * wc = [(PBGitRepository *)document windowController];
225225
PBGitHistoryController * histController = wc.historyController;

PBCLIProxy.m

+4-45
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ - (id)init
3131

3232
- (BOOL) openRepository:(in bycopy NSString *)repositoryPath arguments:(in bycopy NSArray *)args error:(byref NSError **)error
3333
{
34-
NSLog(@"============================== PBCLIProxy START ==============================");
34+
// NSLog(@"============================== PBCLIProxy START ==============================");
3535

3636
if (!repositoryPath || !args) {
3737
return NO;
@@ -66,7 +66,7 @@ - (BOOL) openRepository:(in bycopy NSString *)repositoryPath arguments:(in bycop
6666

6767
*error = [NSError errorWithDomain:PBCLIProxyErrorDomain code:errCode userInfo:userInfo];
6868
}
69-
NSLog(@"============================== PBCLIProxy Abort ==============================");
69+
// NSLog(@"============================== PBCLIProxy Abort ==============================");
7070
return NO;
7171
} else if (![document checkRefFormat:fullargs] &&
7272
![document checkRefFormatForBranch:fullargs]) {
@@ -85,52 +85,11 @@ - (BOOL) openRepository:(in bycopy NSString *)repositoryPath arguments:(in bycop
8585
fprintf(stderr, "\t%s\n", [[*error localizedFailureReason] UTF8String]);
8686
}
8787

88-
NSLog(@"document = %@ at path = %@", document, repositoryPath);
89-
90-
// if ([args count] > 0 && ([[args objectAtIndex:0] isEqualToString:@"--commit"] ||
91-
// [[args objectAtIndex:0] isEqualToString:@"-c"])) {
92-
// [document.windowController showCommitView:self];
93-
// }
94-
// else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"--author"])) {
95-
// NSArray * components = [[args objectAtIndex:0] componentsSeparatedByString:@"="];
96-
// NSString * author = [components objectAtIndex:1];
97-
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
98-
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"author contains[c] %@", author]];
99-
// [document.windowController.historyController.commitList selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
100-
// } else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"--subject"])) {
101-
// NSArray * components = [[args objectAtIndex:0] componentsSeparatedByString:@"="];
102-
// NSString * subject = [components objectAtIndex:1];
103-
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
104-
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"subject contains[c] %@", subject]];
105-
// } else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"--sha"])) {
106-
// NSArray * components = [[args objectAtIndex:0] componentsSeparatedByString:@"="];
107-
// NSString * sha = [components objectAtIndex:1];
108-
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
109-
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"realSha contains[c] %@", sha]];
110-
// } else if ([args count] > 0 && ([[args objectAtIndex:0] hasPrefix:@"-S"])) {
111-
// NSString * subject = [[args objectAtIndex:0] substringFromIndex:2];
112-
// NSArrayController * ccontroller = document.windowController.historyController.commitController;
113-
// [ccontroller setFilterPredicate:[NSPredicate predicateWithFormat:@"subject contains[c] %@", subject]];
114-
// }
115-
116-
// if ([args count] > 0 && [[args objectAtIndex:0] isEqualToString:@"--all"]) {
117-
// document.currentBranchFilter = kGitXAllBranchesFilter;
118-
// } else if ([args count] > 0 && [[args objectAtIndex:0] isEqualToString:@"--local"]) {
119-
// document.currentBranchFilter = kGitXLocalRemoteBranchesFilter;
120-
// }
121-
122-
// [document readCurrentBranch];
123-
// rev = document.currentBranch;
124-
//
125-
// if (!rev && [args count] > 0) {
126-
// rev = [[PBGitRevSpecifier alloc] initWithParameters:args];
127-
// document.currentBranch = rev;
128-
// document.currentBranchFilter = kGitXSelectedBranchFilter;
129-
// }
88+
// NSLog(@"document = %@ at path = %@", document, repositoryPath);
13089

13190
[NSApp activateIgnoringOtherApps:YES];
13291

133-
NSLog(@"============================== PBCLIProxy END ==============================");
92+
// NSLog(@"============================== PBCLIProxy END ==============================");
13493
return YES;
13594
}
13695

PBGitHistoryController.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ - (void) scrollSelectionToTopOfViewFrom:(NSInteger)oldIndex
424424
commitList.useAdjustScroll = YES;
425425
}
426426

427-
NSLog(@"[%@ %s] newIndex = %d, oldIndex = %d", [self class], _cmd, newIndex, oldIndex);
427+
// NSLog(@"[%@ %s] newIndex = %d, oldIndex = %d", [self class], _cmd, newIndex, oldIndex);
428428

429429
[commitList scrollRowToVisible:newIndex];
430430
commitList.useAdjustScroll = NO;
@@ -447,7 +447,7 @@ - (BOOL) selectCommit:(NSString *)commitSHA
447447
if (appController.launchedFromGitx && [appController.cliArgs isEqualToString:@"--commit"]) {
448448
return NO;
449449
}
450-
NSLog(@"[%@ %s]: SHA = %@", [self class], _cmd, commitSHA);
450+
// NSLog(@"[%@ %s]: SHA = %@", [self class], _cmd, commitSHA);
451451
if (!forceSelectionUpdate && [[selectedCommit realSha] isEqualToString:commitSHA])
452452
return NO;
453453

@@ -462,7 +462,7 @@ - (BOOL) selectCommit:(NSString *)commitSHA
462462
[commitController setSelectedObjects:selectedCommits];
463463

464464
if (repository.currentBranchFilter != kGitXSelectedBranchFilter) {
465-
NSLog(@"[%@ %s] currentBranchFilter = %@", [self class], _cmd, PBStringFromBranchFilterType(repository.currentBranchFilter));
465+
// NSLog(@"[%@ %s] currentBranchFilter = %@", [self class], _cmd, PBStringFromBranchFilterType(repository.currentBranchFilter));
466466
[self scrollSelectionToTopOfViewFrom:oldIndex];
467467
}
468468

PBGitSidebarController.m

+11-27
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ - (void)awakeFromNib
6969

7070
- (void)populateList
7171
{
72-
NSLog(@"[%@ %s]", [self class], _cmd);
72+
// NSLog(@"[%@ %s]", [self class], _cmd);
7373

7474
PBSourceViewItem *project = [PBSourceViewItem groupItemWithTitle:[repository projectName]];
7575
project.isUncollapsible = YES;
@@ -166,20 +166,20 @@ - (void)populateList
166166
if (resolvedRev) {
167167
repository.currentBranch = resolvedRev;
168168
//repository.currentBranch.isSimpleRef = YES;
169-
NSLog(@"[%@ %s] currentBranch = %@", [self class], _cmd, repository.currentBranch);
170-
NSLog(@"[%@ %s] items = %@", [self class], _cmd, [items description]);
169+
// NSLog(@"[%@ %s] currentBranch = %@", [self class], _cmd, repository.currentBranch);
170+
// NSLog(@"[%@ %s] items = %@", [self class], _cmd, [items description]);
171171
for (PBSourceViewItem * item in items) {
172172
if (deferredSelectObject = [item findRev:resolvedRev])
173173
break;
174174
}
175-
NSLog(@"[%@ %s] deferredSelectObject = %@", [self class], _cmd, deferredSelectObject);
175+
// NSLog(@"[%@ %s] deferredSelectObject = %@", [self class], _cmd, deferredSelectObject);
176176
}
177177
}
178178
}
179179

180180
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
181181
{
182-
NSLog(@"[%@ %s]", [self class], _cmd);
182+
// NSLog(@"[%@ %s]", [self class], _cmd);
183183

184184
if ([@"currentBranchChange" isEqualToString:context]) {
185185
[sourceView reloadData];
@@ -227,7 +227,7 @@ - (void) selectBranch:(PBSourceViewItem *)branchItem
227227
{
228228
[sourceView PBExpandItem:branchItem expandParents:YES];
229229
NSInteger row = [sourceView rowForItem:branchItem];
230-
NSLog(@"[%@ %s] rowForItem (%@) = %d", [self class], _cmd, branchItem, row);
230+
// NSLog(@"[%@ %s] rowForItem (%@) = %d", [self class], _cmd, branchItem, row);
231231
NSIndexSet *index = [NSIndexSet indexSetWithIndex:row];
232232
[sourceView selectRowIndexes:index byExtendingSelection:NO];
233233
}
@@ -236,7 +236,7 @@ - (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev {
236236
PBSourceViewItem *foundItem = nil;
237237
for (PBSourceViewItem *item in items) {
238238
if (foundItem = [item findRev:rev]) {
239-
NSLog(@"[%@ %s]: found item! Item = %@ for rev = %@", [self class], _cmd, item, rev);
239+
//NSLog(@"[%@ %s]: found item! Item = %@ for rev = %@", [self class], _cmd, item, rev);
240240
return foundItem;
241241
}
242242
}
@@ -245,9 +245,9 @@ - (PBSourceViewItem *) itemForRev:(PBGitRevSpecifier *)rev {
245245

246246
- (BOOL) selectCommitWithSha:(NSString *)refSHA {
247247
NSArray *revList = repository.revisionList.commits;
248-
NSLog(@"[%@ %s] revList = %@", [self class], _cmd, revList);
248+
// NSLog(@"[%@ %s] revList = %@", [self class], _cmd, revList);
249249
for (PBGitCommit *commit in revList) {
250-
NSLog(@"[%@ %s] commit = %@", [self class], _cmd, commit);
250+
// NSLog(@"[%@ %s] commit = %@", [self class], _cmd, commit);
251251
if ([[commit realSha] isEqualToString:refSHA]) {
252252
[historyViewController selectCommit:refSHA];
253253
return YES;
@@ -260,7 +260,7 @@ - (void) selectCurrentBranch
260260
{
261261
PBGitRevSpecifier *rev = repository.currentBranch;
262262

263-
NSLog(@"[%@ %s] rev = %@", [self class], _cmd, rev);
263+
// NSLog(@"[%@ %s] rev = %@", [self class], _cmd, rev);
264264

265265
if (deferredSelectObject) {
266266
NSString * sha = [ApplicationController sharedApplicationController].deferredSelectSha;
@@ -270,7 +270,7 @@ - (void) selectCurrentBranch
270270
}
271271

272272
[self selectBranch:deferredSelectObject];
273-
//[historyViewController selectCommit:sha];
273+
274274
deferredSelectObject = nil;
275275
return;
276276
}
@@ -280,24 +280,8 @@ - (void) selectCurrentBranch
280280
[repository readCurrentBranch];
281281
return;
282282
}
283-
// else {
284-
// NSString * refSHA = [repository shaForRef:[rev ref]];
285-
// if (![self selectCommitWithSha:refSHA]) {
286-
// [repository reloadRefs];
287-
// [self selectCommitWithSha:refSHA];
288-
// }
289-
// }
290283

291284
PBSourceViewItem *item = [self itemForRev:rev];
292-
293-
// if (!item) {
294-
// // Obviously we havn't found the item so we reset it's isSimpleRef status back to NO
295-
// // so it will get added to the OTHER group.
296-
// //[rev setIsSimpleRef:NO];
297-
// [self addRevSpec:rev];
298-
// // Try to find the just added item again.
299-
// item = [self itemForRev:rev];
300-
// }
301285
[self selectBranch:item];
302286
}
303287

PBSourceViewItem.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ - (void)addRev:(PBGitRevSpecifier *)theRevSpecifier toPath:(NSArray *)path
111111

112112
- (PBSourceViewItem *) findRev:(PBGitRevSpecifier *)rev
113113
{
114-
NSLog(@"[%@ %s] rev = %@, revSpecifier = %@", [self class], _cmd, rev, revSpecifier);
114+
// NSLog(@"[%@ %s] rev = %@, revSpecifier = %@", [self class], _cmd, rev, revSpecifier);
115115
if (rev == revSpecifier || [rev isEqual:revSpecifier])
116116
return self;
117117

0 commit comments

Comments
 (0)