Skip to main content

Notice: This Wiki is now read only and edits are no longer 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 (Configuring Hosts for Pull Requests)
(Prepare entry for SSH agent)
Line 43: Line 43:
  
 
: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 ==
 +
 +
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:
 +
<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>
 +
EGit 6.0 additionally has a new preference to enable or disable using an SSH agent globally:
 +
 +
<TBD: insert screenshot>
 +
 +
By default, this setting is switched on, i.e., EGit does use the SSH agent if one is available.
 +
-->
  
 
== Other Changes ==
 
== Other Changes ==

Revision as of 09:33, 24 October 2021

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.


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 X developers worked on this release:

<TBD: list of contributors, number>

See Also

See also the new features in JGit for additional information.

Back to the top