From 0a80eb16cb4f7ef95f1c6c90f5f2157fed803654 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Fri, 26 Sep 2008 02:18:29 +0200 Subject: [PATCH] RevList: Use --early-output to get some first hits quickly This uses the --early-output feature of git logs to display the first few commits quickly --- PBGitRevList.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PBGitRevList.m b/PBGitRevList.m index c3a9be4..f620e76 100644 --- a/PBGitRevList.m +++ b/PBGitRevList.m @@ -78,9 +78,9 @@ struct decorateParameters { BOOL showSign = [rev hasLeftRight]; if (showSign) - arguments = [NSMutableArray arrayWithObjects:@"log", @"--topo-order", @"--pretty=format:%H\01%an\01%s\01%P\01%at\01%m", nil]; + arguments = [NSMutableArray arrayWithObjects:@"log", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%an\01%s\01%P\01%at\01%m", nil]; else - arguments = [NSMutableArray arrayWithObjects:@"log", @"--topo-order", @"--pretty=format:%H\01%an\01%s\01%P\01%at", nil]; + arguments = [NSMutableArray arrayWithObjects:@"log", @"--early-output", @"--topo-order", @"--pretty=format:%H\01%an\01%s\01%P\01%at", nil]; if (!rev) [arguments addObject:@"HEAD"]; @@ -118,10 +118,16 @@ struct decorateParameters { continue; } + if ([currentLine hasPrefix:@"Final output:"]) { + currentLine = [NSMutableString string]; + continue; + } + // If we are here, we currentLine is a full line. NSArray* components = [currentLine componentsSeparatedByString:@"\01"]; if ([components count] < 5) { NSLog(@"Can't split string: %@", currentLine); + currentLine = [NSMutableString string]; continue; } PBGitCommit* newCommit = [[PBGitCommit alloc] initWithRepository: repository andSha: [components objectAtIndex:0]];