Skip to content

Add filtering UI in merge conflict view to handle merges with lots of files #34

Open
@swisspol

Description

@swisspol

The diff view controller was not optimized to render 10,000 diffs if that's what you get 😕

  • What you want starts in the GIConflictResolverViewController class, which itself uses a GIDiffContentsViewController and GIDiffFilesViewController.
  • The contents to display is set in -_reloadContents, and comes from the GCLiveRepository instance (the unifiedStatus and indexConflicts properties).
  • These properties are live updated once enabled by GIConflictResolverViewController using at self.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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions