# acaudwell/gource architecture

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

- Interactive diagram: https://gitdiagram.com/acaudwell/gource
- Repository: https://github.com/acaudwell/gource

## Overview

##### Project type and purpose
- The README confirms its domain (version control visualization), key features (OpenGL rendering, multiple VCS support, extensive CLI options), and its modular design around log parsing, data modeling, rendering, and user interaction.

##### File structure
- Top‐level directories:
- cmd/         – platform‐specific launchers (Windows batch and UNIX shell)
- contrib/     – utility scripts (e.g., svn-gource.py)
- data/        – runtime assets (fonts, shaders, example files)
- dev/         – packaging and build scripts (tar, NSIS, etc.)
- m4/ and configure.ac, Makefile.am, autogen.sh – autotools build system
- src/         – all C++ source code, subdivided into:
– formats/       (VCS adapters: git, svn, hg, bzr, cvs2cl, custom)
– core/          (DirNode, file tree data structures)
– tinyxml/       (embedded XML parser)
– test/          (unit tests)
– other helpers  (action, bloom, caption, camera, spline, slider, key, logmill, main, user, textbox)
- scripts/     – post‐processing scripts (e.g., gource-ps.pl)
- resources/   – source images for assets
- tests/       – input logs and images for automated testing
- Configuration and packaging: configure.ac, automake files, .gitattributes, .gitmodules, etc.

##### README for additional insights
- Dependencies: OpenGL (GL, GLU, GLUT), FreeType (for fonts), C++11, autotools.

##### Final advice
- Be exhaustive: list each formats/* adapter, each rendering shader stage, each input handler.
- Flow from “gource [options]” all the way to the OpenGL swap‐buffers call.
- Non-obvious dependencies (e.g., TinyXML used by caption parsing).

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% CLI Parser Layer
  subgraph "CLI Parser"
    direction TB
    A["main.cpp"]:::core
    B["gource.cpp / gource.h"]:::core
    C["gource_settings.cpp / gource_settings.h"]:::core
    D["gource_shell.cpp / gource_shell.h"]:::core
  end

  %% Log Ingestion Layer
  subgraph "Log Ingestion" 
    direction TB
    E["logmill.cpp / logmill.h"]:::core
    subgraph "VCS Adapters" 
      direction TB
      F1["git.cpp / git.h"]:::external
      F2["svn.cpp / svn.h"]:::external
      F3["hg.cpp / hg.h"]:::external
      F4["bzr.cpp / bzr.h"]:::external
      F5["cvs2cl.cpp / cvs2cl.h"]:::external
      F6["custom.cpp / custom.h"]:::external
      F7["apache.cpp / apache.h"]:::external
      F8["cvs-exp.cpp / cvs-exp.h"]:::external
      F9["gitraw.cpp / gitraw.h"]:::external
      F10["commitlog.cpp / commitlog.h"]:::external
    end
  end

  %% Data Model Layer
  subgraph "Data Model"
    direction TB
    G["dirnode.cpp / dirnode.h"]:::core
    H["file.cpp / file.h"]:::core
    I["user.cpp / user.h"]:::core
    J["action.cpp / action.h"]:::core
  end

  %% Rendering Engine Layer
  subgraph "Rendering Engine"
    direction TB
    K["bloom.cpp / bloom.h"]:::renderui
    L["caption.cpp / caption.h"]:::renderui
    M["pawn.cpp / pawn.h"]:::renderui
    subgraph "Shaders & Textures"
      direction TB
      S1["bloom.vert / bloom.frag"]:::renderui
      S2["shadow.vert / shadow.frag"]:::renderui
      S3["text.vert / text.frag"]:::renderui
      T1["bloom.tga / bloom_alpha.tga"]:::renderui
    end
  end

  %% UI & Interaction Layer
  subgraph "UI & Interaction"
    direction TB
    U1["zoomcamera.cpp / zoomcamera.h"]:::renderui
    U2["spline.cpp / spline.h"]:::renderui
    U3["slider.cpp / slider.h"]:::renderui
    U4["key.cpp / key.h"]:::renderui
    U5["textbox.cpp / textbox.h"]:::renderui
    U6["caption.cpp / caption.h"]:::renderui
  end

  %% Asset Manager Layer
  subgraph "Asset Manager"
    direction TB
    V1["data/fonts/"]:::external
    V2["resources/file.xcf"]:::external
    V3["resources/user.xcf"]:::external
    V4["data/gource.style"]:::external
    V5["data/gource.1"]:::external
  end

  %% Tests Harness Layer
  subgraph "Tests Harness"
    direction TB
    W1["src/test/"]:::core
    W2["tests/logs/"]:::core
    W3["tests/images/"]:::core
    W4["tests/test.conf"]:::core
  end

  %% Packaging & Build System
  subgraph "Packaging & Build System"
    direction TB
    X1["configure.ac / Makefile.am / autogen.sh"]:::build
    X2["m4/"]:::build
    X3["dev/bin/build_tar.pl / build_win64.pl"]:::build
    X4["dev/nsis/"]:::build
    X5["cmd/gource / cmd/gource.cmd"]:::build
    X6["scripts/gource-ps.pl"]:::build
    X7[".gitmodules / .gitattributes / .gitignore"]:::build
  end

  %% Data Flow Connections
  A -->|"settings"| E
  B --> E
  C --> E
  D --> E

  E -->|"parsed events"| G
  E --> G
  E --> H
  E --> I
  E --> J

  G -->|"graph data"| K
  H --> K
  I --> K
  J --> K

  K --> U1
  K --> U2
  K --> U3
  K --> U4
  K --> U5
  K --> U6
  U4 --> K

  V1 --> K
  V2 --> K
  V3 --> K
  V4 --> K
  V5 --> K

  W1 --> E
  W1 --> G
  W2 --> W1
  W3 --> W1
  W4 --> W1

  X1 --> A
  X1 --> E
  X1 --> G
  X1 --> K
  X1 --> U1
  X2 --> X1
  X3 --> X1
  X4 --> X1
  X5 --> X1
  X6 --> X1
  X7 --> X1

  %% Click Events
  click A "https://github.com/acaudwell/gource/blob/master/src/main.cpp"
  click B "https://github.com/acaudwell/gource/blob/master/src/gource.cpp"
  click C "https://github.com/acaudwell/gource/blob/master/src/gource_settings.cpp"
  click D "https://github.com/acaudwell/gource/blob/master/src/gource_shell.cpp"
  click E "https://github.com/acaudwell/gource/blob/master/src/logmill.cpp"
  click F1 "https://github.com/acaudwell/gource/blob/master/src/formats/git.cpp"
  click F2 "https://github.com/acaudwell/gource/blob/master/src/formats/svn.cpp"
  click F3 "https://github.com/acaudwell/gource/blob/master/src/formats/hg.cpp"
  click F4 "https://github.com/acaudwell/gource/blob/master/src/formats/bzr.cpp"
  click F5 "https://github.com/acaudwell/gource/blob/master/src/formats/cvs2cl.cpp"
  click F6 "https://github.com/acaudwell/gource/blob/master/src/formats/custom.cpp"
  click F7 "https://github.com/acaudwell/gource/blob/master/src/formats/apache.cpp"
  click F8 "https://github.com/acaudwell/gource/blob/master/src/formats/cvs-exp.cpp"
  click F9 "https://github.com/acaudwell/gource/blob/master/src/formats/gitraw.cpp"
  click F10 "https://github.com/acaudwell/gource/blob/master/src/formats/commitlog.cpp"
  click G "https://github.com/acaudwell/gource/blob/master/src/dirnode.cpp"
  click H "https://github.com/acaudwell/gource/blob/master/src/file.cpp"
  click I "https://github.com/acaudwell/gource/blob/master/src/user.cpp"
  click J "https://github.com/acaudwell/gource/blob/master/src/action.cpp"
  click K "https://github.com/acaudwell/gource/blob/master/src/bloom.cpp"
  click L "https://github.com/acaudwell/gource/blob/master/src/caption.cpp"
  click M "https://github.com/acaudwell/gource/blob/master/src/pawn.cpp"
  click S1 "https://github.com/acaudwell/gource/blob/master/data/shaders/bloom.vert"
  click S1 "https://github.com/acaudwell/gource/blob/master/data/shaders/bloom.frag"
  click S2 "https://github.com/acaudwell/gource/blob/master/data/shaders/shadow.vert"
  click S2 "https://github.com/acaudwell/gource/blob/master/data/shaders/shadow.frag"
  click S3 "https://github.com/acaudwell/gource/blob/master/data/shaders/text.vert"
  click S3 "https://github.com/acaudwell/gource/blob/master/data/shaders/text.frag"
  click T1 "https://github.com/acaudwell/gource/blob/master/data/bloom.tga"
  click T1 "https://github.com/acaudwell/gource/blob/master/data/bloom_alpha.tga"
  click U1 "https://github.com/acaudwell/gource/blob/master/src/zoomcamera.cpp"
  click U2 "https://github.com/acaudwell/gource/blob/master/src/spline.cpp"
  click U3 "https://github.com/acaudwell/gource/blob/master/src/slider.cpp"
  click U4 "https://github.com/acaudwell/gource/blob/master/src/key.cpp"
  click U5 "https://github.com/acaudwell/gource/blob/master/src/textbox.cpp"
  click U6 "https://github.com/acaudwell/gource/blob/master/src/caption.cpp"
  click V1 "https://github.com/acaudwell/gource/tree/master/data/fonts/"
  click V2 "https://github.com/acaudwell/gource/blob/master/resources/file.xcf"
  click V3 "https://github.com/acaudwell/gource/blob/master/resources/user.xcf"
  click V4 "https://github.com/acaudwell/gource/blob/master/data/gource.style"
  click V5 "https://github.com/acaudwell/gource/blob/master/data/gource.1"
  click W1 "https://github.com/acaudwell/gource/tree/master/src/test/"
  click W2 "https://github.com/acaudwell/gource/tree/master/tests/logs/"
  click W3 "https://github.com/acaudwell/gource/tree/master/tests/images/"
  click W4 "https://github.com/acaudwell/gource/blob/master/tests/test.conf"
  click X1 "https://github.com/acaudwell/gource/blob/master/configure.ac"
  click X1 "https://github.com/acaudwell/gource/blob/master/Makefile.am"
  click X1 "https://github.com/acaudwell/gource/blob/master/autogen.sh"
  click X2 "https://github.com/acaudwell/gource/tree/master/m4/"
  click X3 "https://github.com/acaudwell/gource/blob/master/dev/bin/build_tar.pl"
  click X3 "https://github.com/acaudwell/gource/blob/master/dev/bin/build_win64.pl"
  click X4 "https://github.com/acaudwell/gource/tree/master/dev/nsis/"
  click X5 "https://github.com/acaudwell/gource/tree/master/cmd/gource"
  click X5 "https://github.com/acaudwell/gource/blob/master/cmd/gource.cmd"
  click X6 "https://github.com/acaudwell/gource/blob/master/scripts/gource-ps.pl"
  click X7 "https://github.com/acaudwell/gource/blob/master/.gitmodules"
  click X7 "https://github.com/acaudwell/gource/blob/master/.gitattributes"
  click X7 "https://github.com/acaudwell/gource/blob/master/.gitignore"

  %% Styles
  classDef core fill:#BBE1FA,stroke:#0B3C5D;
  classDef renderui fill:#D5E1DF,stroke:#1F6F8B;
  classDef build fill:#EEEEEE,stroke:#888888;
  classDef external fill:#FFD7BA,stroke:#D1495B;
  classDef config fill:#F6F5F5,stroke:#666666;
```
