CommitFileDiffViewer: better performance for huge commits

Displaying the list of files changed might still freeze the UI for
really huge commits (> 10'000 changed files). Turns out that using a
SWT.VIRTUAL table is much faster for this use case.

Make the FileDiffLabelProvider safe against being passed null elements.
Improve getting icons for the FileDiffs; make sure that already the
base images are cached in the ResourceManager. Avoid using EGit's
DecorationOverlayDescriptor; it loads the base image's ImageData to
determine the size of the base image, and this loading is entirely
uncached!

FileDiffs are shown elsewhere, too, for instance in the fetch result
dialog. Provide an explicit WorkbenchAdapter for these cases. This
still uses the potentially expensive DecorationOverlayDescriptor, but
the separation opens the way to eventually move the decorating into
an asynchronous lightweight decorator, and it's a much less prominent
place, too.

Move the background loading out of the content provider and into
CommitFileDiffViewer; doing this in the content provider confuses
the hell out of a virtual table. Do it properly outside of any
table-related manipulations.

In CommitFileDiffViewer, fix a number of performance problems with
selections:

* "select all" was very slow; instead of going through the content
  provider call selectAll() on the SWT table.
* ensure setSelection(StructuredSelection.EMPTY) goes through
  doDeselectAll().
* Avoid expensive preservingSelection() when the selection is huge by
  clearing it before setInput() if it's known that it cannot re-apply.

Disable SWT.MULTI on GTK with SWT versions < 4919 (Eclipse 4.10).
Combined with SWT.VIRTUAL it may lead to extended UI freezes because
of bug 499850. (No such problem is known on OS X or Windows.) Provide
a new context menu action "Copy All Paths".

Bug: 544237
Change-Id: Ia4634993246e35d6d79a35f3cfa02c0e8127f2ef
Also-by: Thomas Wolf <thomas.wolf@paranor.ch>
Also-by: Andrey Loskutov <loskutov@gmx.de>
Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com>
14 files changed
tree: 4088f94bf5d41dc76b3d38d96336646dac2483d6
  1. .mvn/
  2. icons/
  3. org.eclipse.egit/
  4. org.eclipse.egit-feature/
  5. org.eclipse.egit.core/
  6. org.eclipse.egit.core.junit/
  7. org.eclipse.egit.core.test/
  8. org.eclipse.egit.doc/
  9. org.eclipse.egit.gitflow/
  10. org.eclipse.egit.gitflow-feature/
  11. org.eclipse.egit.gitflow.test/
  12. org.eclipse.egit.gitflow.ui/
  13. org.eclipse.egit.mylyn-feature/
  14. org.eclipse.egit.mylyn.ui/
  15. org.eclipse.egit.mylyn.ui.test/
  16. org.eclipse.egit.repository/
  17. org.eclipse.egit.source-feature/
  18. org.eclipse.egit.target/
  19. org.eclipse.egit.ui/
  20. org.eclipse.egit.ui.importer.tests/
  21. org.eclipse.egit.ui.smartimport/
  22. org.eclipse.egit.ui.test/
  23. tools/
  24. .gitattributes
  25. .gitignore
  26. .project
  27. CONTRIBUTING.md
  28. egit.psf
  29. EGIT_INSTALL
  30. LICENSE
  31. pom.xml
  32. README.md
README.md

Eclipse Git Plugin

EGit is a set of Eclipse plugins for working with Git repositories. It is based on the JGit library, which is a Git implementation in pure Java. This package is licensed under the EPL 2.0. Please refer to the LICENSE file for the complete license.

Components

This package is composed of the following major components.

Implementation

  • org.eclipse.egit: Eclipse branding plugin for EGit.
  • org.eclipse.egit.core: An Eclipse plugin providing an interface to org.eclipse.jgit and support routines to allow processing in an Eclipse workspace. It also supplies the team provider implementation.
  • org.eclipse.egit.gitflow: bundle implementing support for the gitflow branching model.
  • org.eclipse.egit.gitflow.ui: bundle implementing a user interface for the gitflow branching model.
  • org.eclipse.egit.mylyn: bundle integrating EGit with Eclipse Mylyn which provides integration for Eclipse with task tracking systems.
  • org.eclipse.egit.mylyn.ui: bundle integrating EGit user interface with Eclipse Mylyn task based user interface.
  • org.eclipse.egit.target: Eclipse target platform providing EGit 3rd party dependencies for the build and for running EGit in Eclipse workspace.
  • org.eclipse.egit.ui: An Eclipse plugin providing the user interface on top of org.eclipse.egit.core.
  • org.eclipse.egit.ui.importer: An Eclipse plugin integrating the Eclipse smart import wizard to improve importing projects from Git repositories.

Tests

  • org.eclipse.egit.core.junit: Reusable classes used by EGit tests
  • org.eclipse.egit.core.test: Unit tests for org.eclipse.egit.core.
  • org.eclipse.egit.gitflow.test: Unit tests for org.eclipse.egit.gitflow.
  • org.eclipse.egit.mylyn.ui.test: UI tests for org.eclipse.egit.mylyn.ui.
  • org.eclipse.egit.ui.importer.test: UI tests for org.eclipse.egit.ui.smartimport.
  • org.eclipse.egit.ui.test: UI tests for org.eclipse.egit.ui.

Packaging

  • org.eclipse.egit.doc: Documentation bundle packaging EGit documentation. Raw documentation is written in the wiki.
  • org.eclipse.egit-feature: Eclipse feature for installing the core implementation bundles
  • org.eclipse.egit.gitflow-feature: Eclipse feature for installing the optional gitflow bundle.
  • org.eclipse.egit.mylyn-feature: Eclipse feature for installing the EGit task based interface integration.
  • org.eclipse.egit.repository: Definitions for the EGit p2 repository which can be used to install and upgrade EGit, includes all the features and plugins from the JGit p2 repository.
  • org.eclipse.egit.source-feature: Eclipse feature for installing EGit source bundles to help debugging EGit in Eclipse.

Compatibility

  • In general, EGit supports at least the latest two Eclipse releases. For details, please see https://wiki.eclipse.org/EGit/FAQ
  • JGit and EGit releases are versioned according to OSGi semantic versioning
  • Newer version of EGit may implement new functionality, remove existing functions and change others without other notice than what is written in the release notes, commit log and source files themselves.

Features

The following list is not complete, but it gives an overview of the features:

  • org.eclipse.egit.core

    • Supplies an Eclipse team provider.
    • Connect/disconnect the provider to a project.
    • Search for the repositories associated with a project by autodetecting the Git repository directories.
    • Store which repositories are tied to which containers in the Eclipse workspace.
    • Tracks moves/renames/deletes and reflects them in the cache tree.
    • Resolves through linked containers.
  • org.eclipse.egit.ui

    • Connect team provider wizard panels.
    • Connect to Git team provider by making a new repository.
    • Connect to Git team provider by searching local filesystem for existing repository directories.
    • Team actions: track (add), untrack (remove), disconnect, show history, compare version.
    • Resource decorator shows file/directory state in the package explorer and other views.
    • Creating new commits or amending commits.
    • View for staging changes (whole files and partial staging), showing their differences and committing them.
    • Graphical history viewer with the ability to compare versions using eclipse built-in compare editor.
    • Clone, push, pull, fetch
    • Merge, rebase, cherry-pick

Missing Features

  • signing support is incomplete
    • verifying signed objects
    • signing tags
    • signing pushes

Support

Post question or comments to the egit-dev@eclipse.org mailing list. You need to be subscribed to post.

Contributing

See the EGit Contributor Guide.

About Git

More information about Git, its repository format, and the canonical C based implementation can be obtained from the Git website.