# ovid/git-workflow architecture

> Architecture diagram of the GitHub repository ovid/git-workflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ovid/git-workflow
- Repository: https://github.com/ovid/git-workflow

## Overview

##### Main Components

a. Command Layer
- Five main Git extension commands as a group of related components:
- git-refresh
- git-pushback
- git-done
- git-hub (optional)
- git-lab (optional)

b. Configuration Layer
- Configuration management components:
- .git-hub config file handler
- .git-lab config file handler
- Default branch detection system

c. External Dependencies
- GitHub/GitLab API integration
- Local Git system
- Required tools (jq, Perl 5.8+)

**┌─ User Interface Layer ─┐**
- (Command Line Tools)  │
- Core Layer ─────┤
- (Git Operations)      │
- Integration Layer ───┤
- (External Services)   │
- ┘

##### Component Relationships

Following interactions:
- Commands → Git Local Repository
- git-hub/git-lab → Configuration Files
- git-hub → GitHub API
- git-lab → GitLab API
- All commands → Default Branch Detection System

##### Important Details

a. Process Flows:
- Branch creation flow
- Refresh workflow
- Push workflow
- Merge workflow

b. Configuration Requirements:
- Token management
- Repository settings
- User settings

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef command fill:#2962FF,color:white,stroke:none
    classDef optional fill:#4CAF50,color:white,stroke:none
    classDef config fill:#FFD700,color:black,stroke:none
    classDef external fill:#757575,color:white,stroke:none
    classDef process fill:#E1F5FE,color:black,stroke:#0288D1
    
    subgraph CLI["Command Line Interface"]
        GR["git-refresh"]:::command
        GP["git-pushback"]:::command
        GD["git-done"]:::command
        GH["git-hub"]:::optional
        GL["git-lab"]:::optional
        GMM["git-merge-with-master"]:::command
    end

    subgraph Config["Configuration Layer"]
        HC[".git-hub config"]:::config
        LC[".git-lab config"]:::config
        DB["Default Branch Detection"]:::config
    end

    subgraph External["External Integration"]
        GIT["Local Git System"]:::external
        GHAPI["GitHub API"]:::external
        GLAPI["GitLab API"]:::external
        Tools["Required Tools<br/>(jq, Perl 5.8+)"]:::external
    end

    %% Relationships
    GR --> GIT
    GP --> GIT
    GD --> GIT
    GH --> GHAPI
    GL --> GLAPI
    
    GH --> HC
    GL --> LC
    
    GR --> DB
    GP --> DB
    GD --> DB
    GMM --> GIT
    
    %% Tool dependencies
    GR --> Tools
    GP --> Tools
    GD --> Tools
    GH --> Tools
    GL --> Tools

    %% Click events
    click GR "https://github.com/Ovid/git-workflow/tree/main/bin/git-refresh"
    click GP "https://github.com/Ovid/git-workflow/tree/main/bin/git-pushback"
    click GD "https://github.com/Ovid/git-workflow/tree/main/bin/git-done"
    click GH "https://github.com/Ovid/git-workflow/tree/main/bin/git-hub"
    click GL "https://github.com/Ovid/git-workflow/tree/main/bin/git-lab"
    click GMM "https://github.com/Ovid/git-workflow/tree/main/bin/git-merge-with-master"
    click HC "https://github.com/Ovid/git-workflow/tree/main/git-hub-config-example"

    %% Legend
    subgraph Legend
        C1["Core Commands"]:::command
        C2["Optional Commands"]:::optional
        C3["Configuration"]:::config
        C4["External Dependencies"]:::external
    end
```
