Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EGit/New and Noteworthy/6.0

< EGit‎ | New and Noteworthy
Revision as of 21:23, 29 November 2023 by Matthias.sohn.sap.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

EGit

Prerequisites

EGit 6.0 requires Java 11 to run. Previous versions required a minimum of Java 1.8.

The minimum Eclipse platform for EGit 6.0 is Eclipse 2020-09 (4.17). While previous versions could be installed on any Eclipse since Neon.3, EGit 6.0 will not install on Eclipse platforms older than Eclipse 2020-09. (Eclipse 2020-09 was the first Eclipse version that also required Java 11 to run.)

The last EGit version that uses Java 1.8 and that can be installed on Eclipse platforms as old as Neon.3 is EGit 5.13. There will be no new features in the EGit 5.x series.

Fetching Pull Requests

EGit 6.0 has a new feature to fetch pull requests from Github or Gitlab. If a local repository has a remote pointing to Github or Gitlab, there are new commands Fetch Github Pull Request... or Fetch Gitlab Merge Request... in the context menus:

"Screenshot showing the new commands in the context menu of the Git Repositories view"

The command is also available in the Team→Remote sub-menu of the context menu in other views, for instance in the Package Explorer on Eclipse projects from a git repository managed by EGit.

The command opens a dialog to fetch a pull request (called "merge request" on Gitlab). Enter the pull request number, then choose what to do after having fetched it. By default, EGit proposes to create a new local branch for the pull request and then to check out that branch. The input field for the pull request number has content assist showing a list of all available pull requests.

"Screenshot of the dialog for fetching pull requests"

If the user copied a pull request number or the web URL of a pull request before opening the dialog, the dialog automatically fills in that pull request number from the clipboard. So a simple workflow to fetch a pull request is:

  1. On the Github or Gitlab web page for the pull request and copy the URL of the page from the browser's address bar, or copy the pull request number shown on the web page.
  2. In Eclipse, choose Fetch Github Pull Request... or Fetch Gitlab Merge Request....
  3. Click the "Finish" button (or hit the <return> key).


Opening the dialog first, then copying the pull request number or web URL and pasting it into the dialog's input field also works.

Configuring Hosts for Pull Requests

EGit uses the normal git mechanisms for fetching pull requests; it does not use the REST APIs Github or Gitlab offer. It cannot know automatically whether a particular remote refers to a Github or Gitlab host: there is no API in the git protocols to detect what kind of server one connects to. EGit needs to know because the two kinds of servers publish pull requests slightly differently.

EGit thus uses simple host name pattern matching. If the host name in a remote URI is "github.com", it's a Github server, and the Fetch Github Pull Request... command is available. If the host name is "gitlab.com" or "gitlab.somedomain.com" or "gitlab.somedomain.org", it's a Gitlab server, and the Fetch Gitlab Merge Request... command is available.

To support private installations of GitHub Enterprise or Gitlab EE instances at arbitrary host names, users can define additional host name patterns at a new preference page at Preferences→Version Control→Git→Servers:

"Screenshot of the preference page for entering host name patterns"

On this preference page one can define host name patterns and associate them with a git server type ("Github" or "Gitlab"). The fields in the table are editable. Patterns are Java regular expressions matching host names; during editing content assist giving hints about the regular expression syntax is available.

For Github, users also have the option to install the GitHub Mylyn connector, which uses the Github REST API and which provides a different and richer UI. With the Github Mylyn connector, define a "task repository" of type Github/Pull Requests and create a query for open PRs. To fetch a pull request, open it from the Mylyn Tasks view, then click the "Fetch commits from PR" icon top right in the PR editor.

SSH Agent

EGit 6.0 uses an SSH2 agent, if one is running, in SSH public-key authentication. On Windows, EGit supports Pageant, the SSH agent of PuTTY; on other operating systems it uses a Unix domain socket given via environment variable SSH_AUTH_SOCK, which is the normal mechanism used e.g. by the OpenSSH agent.

Use of an SSH agent can be switched on or off globally in EGit 6.0 via a new preference:

"Screenshot of the Egit preferences with the new option for enabling or disabling ussing an SSH agent"

By default, this setting is switched on.

The EGit feature is completely independent of the agent settings in Preferences→General→Network Connections→SSH2.

Limitations

Some directives in the ~/.ssh/config file are not handled yet:

  • IdentityAgent
  • AddKeysToAgent
  • SecurityKeyProvider


Support for these is planned for a future version as it needs upstream changes in the Apache MINA sshd library used by EGit and JGit for SSH communication.

Integration with a native keychain (the UseKeychain directive on Mac) is not supported.

EGit does not do agent forwarding. Use the ProxyJump directive in ~/.ssh/config instead.

Other Changes

EGit 6.0 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.

Contributors

The following 2 developers worked on this release:

Matthias Sohn, Thomas Wolf

Video

You can see the UI changes in action in the Eclipse 2021-12 Java IDE Improvements video.

Known Issues

  • SSH: Bug 577545: A bug in the SSH library used by EGit and JGit since 5.13.0, Apache MINA sshd 2.7.0, may cause SSH authentication to fail if first an RSA key is tried, which the server rejects, and then the correct key of a different type (EcDSA or ed25519) is tried.
    • Affected: EGit 5.13.x and 6.0.x
    • Remedies:
      • Update to EGit nightly via its update site.
      • Or specify the exact key to use in ~/.ssh/config using the IdentityFile and IdentitiesOnly yes settings for the host entry of a host where the problem occurs.
      • Or if you use default SSH keys, for instance via the "Private keys" setting at Preferences→General→Network Connections→SSH2 in Eclipse, place id_rsa last in the list.
      • Or use an external SSH executable by setting the GIT_SSH environment variable.
  • UI: Bug 577853: A bug in the Git History page may lead to laggy UI or slow editing when editing a new, not yet committed file, if and when the history page is present.
    • Affected: All installations of EGit 6.0.0. EGit 5.13.0 and earlier are not affected.
    • Remedy: Update to EGit nightly via its update site.

See Also

See also the new features in JGit for additional information.

Back to the top