-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
The diff view controller was not optimized to render 10,000 diffs if that's what you get 😕
- What you want starts in the
GIConflictResolverViewControllerclass, which itself uses aGIDiffContentsViewControllerandGIDiffFilesViewController. - The contents to display is set in
-_reloadContents, and comes from theGCLiveRepositoryinstance (theunifiedStatusandindexConflictsproperties). - These properties are live updated once enabled by
GIConflictResolverViewControllerusing atself.repository.statusMode = kGCLiveRepositoryStatusMode_Unified;. - The property live update happens in
-[GCLiveRepository _updateStatus]where the diffs are actually computed.
So basically one approach would be to add an extra parameter to the diff APIs so allow filtering based on name or file state or whatever you want. The actual implementation is in:
- (GCDiff*)_diffWithType:(GCDiffType)type
filePattern:(NSString*)filePattern
options:(GCDiffOptions)options
maxInterHunkLines:(NSUInteger)maxInterHunkLines
maxContextLines:(NSUInteger)maxContextLines
error:(NSError**)error
block:(int (^)(git_diff** outDiff, git_diff_options* diffOptions))block {
...
}
Then this parameter is is turn exposed on GCLiveRepository and can eventually be set by GIConflictResolverViewController as needed.
andreyz, lolgear and azizhk