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

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:

<TODO: insert screenshot(s) of new context menus>

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.

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 also 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 announce 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→Team→Git→Servers:

<TODO: insert screenshot of new preference page>

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

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