This project is authored cross-platform but has not been compiled or run in the environment it was written in: Eclipse Tycho needs network access to resolve the Eclipse Platform target (
https://download.eclipse.org/...), which isn't available in that sandbox. Review the Java carefully; build and manually test it on a machine with a JDK 17 + Maven + network — the same caveatvs/BUILD.md(Windows-only VSIX) andjetbrains/BUILD.md(JDK + IntelliJ Platform) already carry.
The Eclipse host is the fifth host of the project, alongside the VS Code
extension, the Visual Studio VSIX, the JetBrains-family plugin, and the browser
demo. Like every host, it embeds the same shared web renderer
(packages/graph-webview) and speaks the same protocol
(packages/protocol). Only the thin data/message layer is host-specific, and
here it is a hand-port to Java that mirrors jetbrains/.../GitService.kt /
Dtos.kt / WebViewHostPanel.kt almost line-for-line:
| Concern | File |
|---|---|
Git operations (git CLI via ProcessBuilder) |
src/.../git/GitService.java |
Protocol DTOs (hand-mirrored from packages/protocol) |
src/.../model/Dtos.java |
Message host (SWT Browser + BrowserFunction bridge) |
src/.../WebViewHost.java |
| Dependency-free JSON codec (so the bundle needs no Gson) | src/.../util/Json.java |
| The Eclipse view | src/.../RevisionGraphView.java |
| Open command handler | src/.../OpenRevisionGraphHandler.java |
The SWT Browser widget hosts the bundle exactly the way the JetBrains JCEF
host does: the JS→host channel reuses the very same
window.__ideHostPostMessage__ hook (here it's an SWT BrowserFunction), and
the host→webview channel pushes events with window.postMessage. So
packages/graph-webview/src/host-bridge.ts needs no Eclipse-specific
branch — the existing JCEF branch already covers it.
eclipse/
pom.xml # Tycho parent (target platform, modules)
com.hunkontech.revgraph/ # the OSGi plugin
META-INF/MANIFEST.MF # OSGi bundle manifest (deps, version)
plugin.xml # view + command + menu/toolbar contributions
build.properties # PDE: what goes into the jar (incl. webview/)
pom.xml # packaging: eclipse-plugin
src/com/hunkontech/revgraph/... # the Java host (see table above)
webview/index.html # static; main.js/main.css/schematics staged by build
icons/
com.hunkontech.revgraph.feature/ # installable feature (wraps the plugin)
feature.xml, build.properties, pom.xml
com.hunkontech.revgraph.repository/ # p2 update site (eclipse-repository)
category.xml, pom.xml
- JDK 17.
- Maven 3.9+.
- Node.js 18+ (to build the shared web renderer).
- Git on
PATH. - Network access to the Eclipse p2 repositories (target platform resolution).
- An Eclipse IDE (2024-06 or later recommended, for its modern SWT Browser engine) to install and try the built plugin.
-
Build the shared web renderer and stage it into the plugin's
webview/folder (index.htmlis already checked in; this addsmain.js,main.css,schematics/):npm install npm run build:core npm run build:webview npm run build:eclipse-assets -
Build the plugin, feature and update site with Tycho:
mvn -f eclipse/pom.xml clean packageOutputs:
eclipse/com.hunkontech.revgraph/target/com.hunkontech.revgraph-*.jar— the plugin.eclipse/com.hunkontech.revgraph.repository/target/repository/— a p2 update site directory.eclipse/com.hunkontech.revgraph.repository/target/*.zip— the same site zipped, for attaching to a GitHub Release.
-
Install into Eclipse: Help → Install New Software… → Add… → Local…, point it at the
target/repository/directory (or the zip via Archive…), select Git Tools → Revision Graph for Git, finish, restart.
- Open a project that is inside a Git repository.
- Open the graph via the top-level Revision Graph menu, the toolbar button, or Window → Show View → Other… → Git → Revision Graph.
- The graph shows commits, local & remote branches, tags and stashes as connected boxes — the same shared renderer as the VS Code, Visual Studio and JetBrains hosts, pixel-for-pixel. Right-click a box for the same context menu: create branch, checkout, merge, rename/undo a local commit, copy SHA…
Unlike the VS Code / Visual Studio / JetBrains marketplaces, the Eclipse Marketplace does not host the artifact. A Marketplace listing is just a record that points at a p2 update site URL. So publishing means:
- Build the update site (step 2 above).
- Deploy
target/repository/to a stable URL — this repo publishes it to GitHub Pages and also attaches the zipped site to each GitHub Release (see thebuild-eclipse-pluginjob in.github/workflows/release.yml). - Create/refresh the Marketplace listing once at https://marketplace.eclipse.org/ so it points at that update-site URL (a one-time manual step, comparable to the one-time first upload the JetBrains Marketplace needs). The "Install" / drag-to-install button then pulls from the published site.
Because the Marketplace pulls from the site URL, updating the plugin is just a matter of the release workflow republishing the site — no per-release Marketplace API upload is required (there isn't one).
- Reword/undo of a non-HEAD commit uses pure git plumbing (
commit-tree+update-ref), identical to the JetBrains host and unlike the Visual Studio host's PowerShell-scriptedgit rebase -i. It therefore requires a clean working tree and can never report a mid-op conflict. See the doc comments onGitService.rewordCommit/undoCommit. - Renaming a branch and rewording a commit expect their new-name/new-message prompt to come from a future native dialog (same follow-up the JetBrains host notes); the git plumbing is wired and ready.
- The webview bundle loads from a
file://URL under the bundle's per-user state location (Platform.getStateLocation(bundle)/webview/<version>), since SWT'sBrowser(like JCEF) can't load resources straight out of the plugin JAR. It's extracted once per plugin version and cached there, so an update re-extracts instead of serving a stale bundle. - Auto-refresh watches the Eclipse resource tree for changes under
.git. When.gitisn't part of the workspace resource tree, the graph still refreshes after every mutating operation and via the webview's manual refresh button.