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

Difference between revisions of "EGit/New and Noteworthy/6.0"

m
(Known Issues)
(5 intermediate revisions by 3 users not shown)
Line 44: Line 44:
 
:For Github, users also have the option to install the [https://www.eclipse.org/egit/download/ 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.
 
:For Github, users also have the option to install the [https://www.eclipse.org/egit/download/ 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 ==
 
== SSH Agent ==
  
EGit 6.0 uses an SSH2 agent, if one is running, in SSH publickey 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. Note that the Apache MINA sshd library used for SSH connections uses keys provided by the agent in preference over any other public keys. If a certain SSH connection should not use the agent, specify the key to use explicitly in the <tt>~/.ssh/config</tt> file and set "<tt>IdentitiesOnly yes</tt>", for instance:
+
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 '''<tt>SSH_AUTH_SOCK</tt>''', which is the normal mechanism used e.g. by the OpenSSH agent.
<pre style="margin-left:1em;">
+
Host git.somehost.org
+
Hostname git.somehost.org
+
Port 22
+
User git
+
IdentityFile ~/.ssh/id_ed25519.somehost
+
IdentitiesOnly yes
+
</pre>
+
The <tt>IdentityAgent</tt> directive is ''not'' handled yet; this 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.
+
  
EGit 6.0 additionally has a new preference to enable or disable using an SSH agent globally:
+
Use of an SSH agent can be switched on or off globally in EGit 6.0 via a new preference:
  
<TBD: insert screenshot>
+
[[File:EGit_6.0_SSH_agent_Preference.png|alt="Screenshot of the Egit preferences with the new option for enabling or disabling ussing an SSH agent"]]
  
By default, this setting is switched on, i.e., EGit does use the SSH agent if one is available.
+
By default, this setting is ''switched on''.
 +
 
 +
The EGit feature is completely independent of the agent settings in ''Preferences&rarr;General&rarr;Network Connections&rarr;SSH2''.
 +
 
 +
=== Limitations ===
 +
 
 +
Some directives in the <tt>~/.ssh/config</tt> file are not handled yet:
 +
 
 +
* <tt>IdentityAgent</tt>
 +
* <tt>AddKeysToAgent</tt>
 +
* <tt>SecurityKeyProvider</tt>
 +
 
 +
 
 +
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 <tt>UseKeychain</tt> directive on Mac) is not supported.
 +
 
 +
EGit does ''not'' do agent forwarding. Use the <tt>ProxyJump</tt> directive in <tt>~/.ssh/config</tt> instead.
  
Note that EGit does ''not'' do agent forwarding. Use the <tt>ProxyJump</tt> directive in <tt>~/.ssh/config</tt> instead.
 
-->
 
 
== Other Changes ==
 
== Other Changes ==
  
Line 72: Line 77:
 
= Contributors =
 
= Contributors =
  
The following X developers worked on this release:
+
The following 2 developers worked on this release:
 +
 
 +
Matthias Sohn,
 +
Thomas Wolf
 +
 
 +
= Video =
 +
 
 +
You can see the UI changes in action in the [https://youtu.be/3W9bvidcO20?t=663 Eclipse 2021-12 Java IDE Improvements] video.
 +
 
 +
= Known Issues =
 +
 
 +
* SSH: [https://bugs.eclipse.org/bugs/show_bug.cgi?id=577545 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 [https://download.eclipse.org/egit/updates-nightly update site].
 +
*** Or specify the exact key to use in <tt>~/.ssh/config</tt> using the <tt>IdentityFile</tt> and <tt>IdentitiesOnly yes</tt> 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&rarr;General&rarr;Network Connections&rarr;SSH2'' in Eclipse, place <tt>id_rsa</tt> last in the list.
 +
*** Or use an external SSH executable by setting the <tt>GIT_SSH</tt> environment variable.
  
<TBD: list of contributors, number>
+
* UI: [https://bugs.eclipse.org/bugs/show_bug.cgi?id=577853 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 [https://download.eclipse.org/egit/updates-nightly update site].
  
 
= See Also =
 
= See Also =
  
 
See also the [[JGit/New_and_Noteworthy/6.0|new features in JGit]] for additional information.
 
See also the [[JGit/New_and_Noteworthy/6.0|new features in JGit]] for additional information.

Revision as of 16:17, 6 January 2022

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