How neophack/vscode-git-graph-rs works
Git Graph RS is a VS Code Git-history and repository-inspection extension backed by an in-process Rust read engine, with Git CLI fallback for unsupported reads and writes. The principal flow is user → extension/repository selection → backend → repository data → graph and detail views. Distinct read stages include refs/history, details and diffs, file content, search, and configuration; write actions and optional integrations branch separately. Paths and edges reflect the README and sampled source; unsampled subsystem wiring is kept broad or omitted.
Main entry points: lib.rs Node API Binding · main.ts Graph Webview · dataSource.ts Data Source · extension.ts Extension Activation
Components 28
Extension Host
- Extension Activation
src/extension.ts - Repository Manager
src/repoManager.ts - Data Source
src/dataSource.ts - Backend Router
src/backend/index.ts - Addon Loader
src/backend/addon.ts - Write Commands
src/commands.ts
Rust Read Engine
- Node API Binding
native/node/src/lib.rs - Repository Handle Cache
native/core/src/repository.rs - History And Graph
native/core/src/graph.rs - Refs And Stashes
native/core/src/refs.rs - Commit Details
native/core/src/details.rs - Diffs And Comparisons
native/core/src/diff.rs - File Content
native/core/src/blob.rs - History Search
native/core/src/log.rs - Repository Config
native/core/src/config.rs
Graph Views
- Graph Webview
web/main.ts - Commit Detail View
web/commitDetailsView.ts - Binary Compare View
src/binaryCompareView.ts - Gerrit View
web/gerritView.ts
Writes And Integrations
- Git CLI Backend
src/backend/cliBackend.ts - Gerrit Integration
src/gerrit.ts - Pull Request Links
src/pullRequests.ts - Avatar Lookup
src/avatarManager.ts
Other components
- User
- Git Repository
- Git CLI
- Gerrit Server
- Avatar Services
Connections 34
- User → Extension Activation: uses
- Extension Activation → Repository Manager: manages repositories
- Extension Activation → Data Source: provides data
- Data Source → Backend Router: requests Git data
- Backend Router → Addon Loader: tries engine
- Backend Router → Git CLI Backend: falls back
- Addon Loader → Node API Binding: loads
- Git CLI Backend → Git CLI: runs commands
- Node API Binding → Repository Handle Cache: gets handle
- Node API Binding → History And Graph: dispatches
- Node API Binding → Refs And Stashes: dispatches
- Node API Binding → Commit Details: dispatches
- Node API Binding → Diffs And Comparisons: dispatches
- Node API Binding → File Content: dispatches
- Node API Binding → History Search: dispatches
- Node API Binding → Repository Config: dispatches
- Repository Handle Cache → Git Repository: opens and caches
- History And Graph → Git Repository: reads history
- Refs And Stashes → Git Repository: reads refs
- Commit Details → Git Repository: reads details
- Diffs And Comparisons → Git Repository: reads diffs
- File Content → Git Repository: reads blobs
- History Search → Git Repository: searches history
- Repository Config → Git Repository: reads config
- Data Source → Graph Webview: sends view data
- Graph Webview → Commit Detail View: opens details
- Data Source → Binary Compare View: supplies file comparison
- Write Commands → Git CLI Backend: performs writes
- Graph Webview → Write Commands: requests actions
- Gerrit Integration → Gerrit Server: fetches changes
- Gerrit View → Gerrit Integration: requests review data
- Graph Webview → Gerrit View: shows review details
- Pull Request Links → Graph Webview: provides links
- Avatar Lookup → Avatar Services: fetches images