# fosorio/egit architecture

> Architecture diagram of the GitHub repository fosorio/egit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fosorio/egit
- Repository: https://github.com/fosorio/egit

## Overview

##### Main Components Overview

a. UI Layer (org.eclipse.egit.ui)
- Provides the user interface components
- Handles user interactions
- Implements views, dialogs, and wizards

b. Core Layer (org.eclipse.egit.core)
- Provides the business logic
- Interfaces with JGit library
- Manages Eclipse workspace integration

c. GitFlow Integration (org.eclipse.egit.gitflow)
- Implements GitFlow workflow support
- Provides GitFlow-specific operations

d. Test Components
- Core tests (org.eclipse.egit.core.test)
- UI tests (org.eclipse.egit.ui.test)
- GitFlow tests (org.eclipse.egit.gitflow.test)

##### Component Relationships

a. Dependencies:
- UI → Core (UI depends on Core)
- Core → JGit (Core depends on JGit library)
- GitFlow → Core (GitFlow depends on Core)
- GitFlow UI → GitFlow (GitFlow UI depends on GitFlow)

b. Integration Points:
- Eclipse Platform integration
- Workspace resource management
- Team provider implementation

##### Key Subsystems
Specialized components:

a. Repository Management
- Repository handling
- Git operations (clone, push, pull)
- Branch management

b. Synchronization
- Workspace synchronization
- Resource tracking
- Change management

c. User Interface Components
- Views (History, Staging, Repositories)
- Dialogs and wizards
- Decorators

##### External Interfaces
Integration with:

a. Eclipse Platform
- Resource management
- Team provider API
- UI extension points

b. JGit Library
- Git operations
- Repository access

##### Additional Details

Annotations for:

a. Extension Points:
- branchNameProvider
- cloneSourceProvider
- commitMessageProvider

b. Key Services:
- GitProvider
- RepositoryCache
- GitProjectData

c. Important Operations:
- Commit handling
- Branch operations
- Synchronization

##### Implementation Notes

a. Use a hierarchical layout from top to bottom
b. Keep related components close together
c. Minimize line crossings
e. Version information and dependencies
f. Integration points with Eclipse

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef ui fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef core fill:#90EE90,stroke:#333,stroke-width:2px
    classDef gitflow fill:#FFE5CC,stroke:#333,stroke-width:2px
    classDef test fill:#FFE5E5,stroke:#333,stroke-width:2px
    classDef external fill:#E6E6E6,stroke:#333,stroke-width:2px

    %% External Dependencies
    subgraph External
        Eclipse["Eclipse Platform"]:::external
        JGit["JGit Library"]:::external
    end

    %% Main Components
    subgraph MainComponents
        %% UI Layer
        subgraph UILayer
            UI["UI Layer"]:::ui
            Views["Views & Dialogs"]:::ui
            Actions["UI Actions"]:::ui
            RepoView["Repository View"]:::ui
        end

        %% Core Layer
        subgraph CoreLayer
            Core["Core Layer"]:::core
            GitProv["Git Provider"]:::core
            RepoCache["Repository Cache"]:::core
            ProjData["Project Data"]:::core
            Sync["Synchronization"]:::core
        end

        %% GitFlow
        subgraph GitFlowLayer
            GitFlow["GitFlow Integration"]:::gitflow
            GitFlowOps["GitFlow Operations"]:::gitflow
        end
    end

    %% Test Components
    subgraph TestComponents
        CoreTest["Core Tests"]:::test
        UITest["UI Tests"]:::test
        GitFlowTest["GitFlow Tests"]:::test
    end

    %% Relationships
    UI --> Core
    Core --> JGit
    GitFlow --> Core
    Views --> UI
    Actions --> UI
    RepoView --> UI
    GitProv --> Core
    RepoCache --> Core
    ProjData --> Core
    Sync --> Core
    GitFlowOps --> GitFlow
    Core --> Eclipse
    CoreTest --> Core
    UITest --> UI
    GitFlowTest --> GitFlow

    %% Click events
    click UI "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal"
    click Core "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.core/src/org/eclipse/egit/core"
    click GitFlow "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.gitflow/src/org/eclipse/egit/gitflow"
    click CoreTest "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test"
    click UITest "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test"
    click GitFlowTest "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.gitflow.test/src/org/eclipse/egit/gitflow/test"
    click RepoView "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository"
    click Sync "https://github.com/fosorio/egit/tree/master/org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize"

    %% Legend
    subgraph Legend
        UI_Legend["UI Components"]:::ui
        Core_Legend["Core Components"]:::core
        GitFlow_Legend["GitFlow Components"]:::gitflow
        Test_Legend["Test Components"]:::test
        External_Legend["External Dependencies"]:::external
    end
```
