EGit/New and Noteworthy/5.12
- Staging view shows info about conflict type.
- Replace With→Ours/Theirs removes the file and stages the deletion if the file was deleted in the ours or theirs commit. Simplifies resolving modify-delete conflicts.
- Replace With→Ours/Theirs in Package Explorer/Project Explorer.
- Merge Editor improvements
EGit 5.12 offers new API giving third-party bundles access to git information.
org.eclipse.egit.core bundle offers the following new interfaces and classes:
org.eclipse.egit.core.info.GitInfo: this accessor interface can be obtained via adaptation using Adapters.adapt(someObject, GitInfo.class);. Via the interface, clients can determine the JGit Repository the item is in, its path within the repository, whether it is from the working tree, the git index, or a commit (and if so, which commit), and what its git state is.
- someObject can be anything; in particular it could be an org.eclipse.core.resources.IFile or an org.eclipse.team.core.history.IFileRevision or an org.eclipse.compare.ITypedElement.
- If GitInfo.getRepository() == null, someObject is not in an EGit-managed git repository.
- If the adaptation itself returns null, the item is either not in an EGit-managed git repository, or EGit doesn't know how to provide a GitInfo for someObject.
org.eclipse.egit.core.info.GitItemState: this can be obtained via GitInfo.getGitState() and tells the git state for the item in the git repository at that path. This can be used to determine whether the item has staged changes in the index, whether it was modified in the working tree only, whether it is in a conflict state, and so on. (Client code can also obtain such information given the repository and the git path by using JGit directly and looking up the information directly in the git index. GitItemState may be more efficient since it uses an optimized cache inside EGit that EGit uses internally, too.)
org.eclipse.egit.core.revisions.FileRevisionFactoryexposes factory methods to create org.eclipse.team.core.history.IFileRevision objects for items in the git index or in a git commit. This is useful if client code wants to compare items from a git repository.
org.eclipse.egit.core.util.RevCommitUtilsoffers some utility methods; in particular a method to determine the "theirs" commit in a conflict.
Existing client code is strongly encouraged to use this new API instead of accessing EGit internal non-API classes directly.
EGit 5.12 includes some less noticeable improvements in the UI, plus a number of bug fixes. The complete list of new features and bug fixes is available in the release notes.
The following X developers worked on this release:
<TBD: list of contributors, number>
See also the new features in JGit for additional information.