git-graphable 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- git_graphable-0.4.0/.github/actions/git-graphable/action.yml +76 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.github/workflows/ci.yml +8 -0
- git_graphable-0.4.0/CHANGELOG.md +51 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/Justfile +9 -1
- {git_graphable-0.3.0 → git_graphable-0.4.0}/PKG-INFO +49 -18
- {git_graphable-0.3.0 → git_graphable-0.4.0}/README.md +47 -16
- {git_graphable-0.3.0 → git_graphable-0.4.0}/STYLING.md +6 -1
- {git_graphable-0.3.0 → git_graphable-0.4.0}/USAGE.md +33 -8
- {git_graphable-0.3.0 → git_graphable-0.4.0}/examples/EXAMPLES.md +29 -11
- git_graphable-0.4.0/graph.html +573 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/pyproject.toml +15 -1
- git_graphable-0.4.0/report_output/final_report.json +34 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/report_output/plus_metadata.json +1 -1
- {git_graphable-0.3.0 → git_graphable-0.4.0}/report_output/report.html +102 -48
- git_graphable-0.4.0/report_output/screenshots/test_interactivity_toggling_chromium__failure.png +0 -0
- git_graphable-0.4.0/src/git_graphable/bare_cli.py +329 -0
- git_graphable-0.4.0/src/git_graphable/cli.py +29 -0
- git_graphable-0.4.0/src/git_graphable/cli_utils.py +17 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/commands.py +41 -18
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/core.py +30 -0
- git_graphable-0.4.0/src/git_graphable/default_config.toml +54 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/highlighter.py +156 -143
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/hygiene.py +20 -11
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/issues.py +1 -2
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/parser.py +46 -25
- git_graphable-0.4.0/src/git_graphable/rich_cli.py +348 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/styler.py +332 -13
- git_graphable-0.4.0/src/git_graphable/templates.py +137 -0
- git_graphable-0.4.0/tests/test_bare_cli.py +88 -0
- git_graphable-0.4.0/tests/test_cli.py +30 -0
- git_graphable-0.4.0/tests/test_cli_utils.py +16 -0
- git_graphable-0.4.0/tests/test_examples_html.py +110 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_hygiene.py +4 -3
- git_graphable-0.4.0/tests/test_interactive_html.py +120 -0
- git_graphable-0.4.0/tests/test_parser.py +93 -0
- git_graphable-0.4.0/tests/test_rich_cli.py +99 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_styler.py +1 -2
- git_graphable-0.4.0/tests/test_ui_interactive.py +95 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/uv.lock +132 -1
- git_graphable-0.3.0/CHANGELOG.md +0 -26
- git_graphable-0.3.0/report_output/final_report.json +0 -30
- git_graphable-0.3.0/src/git_graphable/cli.py +0 -627
- git_graphable-0.3.0/tests/test_cli.py +0 -139
- git_graphable-0.3.0/tests/test_parser.py +0 -43
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.gemini/GEMINI.md +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.gemini/code-ordering.md +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.github/dependabot.yml +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.github/workflows/publish.yml +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.gitignore +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/.python-version +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/SECURITY.md +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/examples/generate_demos.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/__init__.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/github.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/src/git_graphable/models.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_config.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_core.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_github.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_highlighter.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_issues.py +0 -0
- {git_graphable-0.3.0 → git_graphable-0.4.0}/tests/test_models.py +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
name: 'Git Graphable'
|
|
2
|
+
description: 'Generate interactive Git hygiene graphs and reports.'
|
|
3
|
+
author: 'TheTrueSCU'
|
|
4
|
+
branding:
|
|
5
|
+
icon: 'activity'
|
|
6
|
+
color: 'blue'
|
|
7
|
+
|
|
8
|
+
inputs:
|
|
9
|
+
path:
|
|
10
|
+
description: 'Path to the git repository'
|
|
11
|
+
required: false
|
|
12
|
+
default: '.'
|
|
13
|
+
production_branch:
|
|
14
|
+
description: 'The main production branch (e.g. main, master)'
|
|
15
|
+
required: false
|
|
16
|
+
default: 'main'
|
|
17
|
+
issue_engine:
|
|
18
|
+
description: 'Issue tracker engine (github or jira)'
|
|
19
|
+
required: false
|
|
20
|
+
github_token:
|
|
21
|
+
description: 'GitHub token for issue integration'
|
|
22
|
+
required: false
|
|
23
|
+
default: ${{ github.token }}
|
|
24
|
+
output_dir:
|
|
25
|
+
description: 'Directory to save the generated reports'
|
|
26
|
+
required: false
|
|
27
|
+
default: 'git-graph-reports'
|
|
28
|
+
|
|
29
|
+
runs:
|
|
30
|
+
using: 'composite'
|
|
31
|
+
steps:
|
|
32
|
+
- name: Setup uv
|
|
33
|
+
uses: astral-sh/setup-uv@v5
|
|
34
|
+
with:
|
|
35
|
+
enable-cache: true
|
|
36
|
+
|
|
37
|
+
- name: Install git-graphable
|
|
38
|
+
shell: bash
|
|
39
|
+
run: |
|
|
40
|
+
# Prefer installing local source if we are in the git-graphable repo
|
|
41
|
+
ROOT_DIR="${{ github.action_path }}/../../.."
|
|
42
|
+
if [ -f "$ROOT_DIR/pyproject.toml" ] && grep -q "name = \"git-graphable\"" "$ROOT_DIR/pyproject.toml"; then
|
|
43
|
+
echo "Installing git-graphable from local source: $ROOT_DIR"
|
|
44
|
+
uv tool install "$ROOT_DIR"
|
|
45
|
+
else
|
|
46
|
+
echo "Installing git-graphable from PyPI"
|
|
47
|
+
uv tool install git-graphable
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
- name: Create output directory
|
|
51
|
+
shell: bash
|
|
52
|
+
run: mkdir -p ${{ inputs.output_dir }}
|
|
53
|
+
|
|
54
|
+
- name: Generate Simplified Graph (Mermaid)
|
|
55
|
+
shell: bash
|
|
56
|
+
run: |
|
|
57
|
+
ARGS="--production-branch ${{ inputs.production_branch }} --simplify --engine mermaid -o ${{ inputs.output_dir }}/summary.mmd"
|
|
58
|
+
if [ -n "${{ inputs.issue_engine }}" ]; then ARGS="$ARGS --issue-engine ${{ inputs.issue_engine }}"; fi
|
|
59
|
+
uv tool run git-graphable --bare ${{ inputs.path }} $ARGS
|
|
60
|
+
env:
|
|
61
|
+
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
62
|
+
|
|
63
|
+
- name: Generate Full Interactive Graph (HTML)
|
|
64
|
+
shell: bash
|
|
65
|
+
run: |
|
|
66
|
+
ARGS="--production-branch ${{ inputs.production_branch }} --engine html -o ${{ inputs.output_dir }}/graph.html"
|
|
67
|
+
if [ -n "${{ inputs.issue_engine }}" ]; then ARGS="$ARGS --issue-engine ${{ inputs.issue_engine }}"; fi
|
|
68
|
+
uv tool run git-graphable --bare ${{ inputs.path }} $ARGS
|
|
69
|
+
env:
|
|
70
|
+
GITHUB_TOKEN: ${{ inputs.github_token }}
|
|
71
|
+
|
|
72
|
+
- name: Upload Reports
|
|
73
|
+
uses: actions/upload-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: git-graph-reports
|
|
76
|
+
path: ${{ inputs.output_dir }}
|
|
@@ -17,6 +17,8 @@ jobs:
|
|
|
17
17
|
steps:
|
|
18
18
|
- name: Checkout repository
|
|
19
19
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
20
|
+
with:
|
|
21
|
+
fetch-depth: 0
|
|
20
22
|
|
|
21
23
|
- name: Install uv
|
|
22
24
|
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
|
|
@@ -31,3 +33,9 @@ jobs:
|
|
|
31
33
|
|
|
32
34
|
- name: Run checks
|
|
33
35
|
run: just check
|
|
36
|
+
|
|
37
|
+
- name: Git Graph Reports
|
|
38
|
+
uses: ./.github/actions/git-graphable
|
|
39
|
+
with:
|
|
40
|
+
production_branch: 'main'
|
|
41
|
+
output_dir: 'git-graph-reports'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.4.0] - 2026-03-05
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Interactive HTML Viewer**: New `--engine html` output that generates a self-contained interactive graph using Cytoscape.js.
|
|
9
|
+
- Includes searchable nodes and a details sidebar with live highlight toggling.
|
|
10
|
+
- Preserves all visual themes and highlighting styles.
|
|
11
|
+
- Lightweight and portable with zero local dependencies.
|
|
12
|
+
- **Performance Optimizations**:
|
|
13
|
+
- **Parallel Log Parsing**: Parallelized `GitCommit` instantiation using `ProcessPoolExecutor` for large repositories.
|
|
14
|
+
- **Parallel Hygiene Scoring**: Concurrent execution of hygiene checks using `ThreadPoolExecutor` for faster report generation.
|
|
15
|
+
- **Modular CLI Architecture**:
|
|
16
|
+
- Split into `rich_cli` (Typer/Rich) and `bare_cli` (Argparse) for better environment support.
|
|
17
|
+
- Intelligent switcher logic in `cli.py` handles optional dependencies and fallbacks.
|
|
18
|
+
- **New `init` Command**: Easily initialize a default `.git-graphable.toml` configuration file.
|
|
19
|
+
- **Reusable GitHub Action**: Added a composite action in `.github/actions/git-graphable/` for automated reporting.
|
|
20
|
+
- **Robust Distance/Divergence Highlights**: Enhanced visualization of branch distance and divergence with clearer legend labels.
|
|
21
|
+
- **Remote URL Support**: Restored and improved ability to pass remote Git URLs (HTTPS/SSH) as the repository path.
|
|
22
|
+
- **Comprehensive UI Testing**: Integrated Playwright for automated browser-based UI testing of the interactive graph.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- **Command Renamed**: Renamed the primary command from `convert` to `analyze` for better semantic alignment.
|
|
26
|
+
- **Decoupled Hygiene Scoring**: Scoring logic is now independent of visual highlighting options, allowing for more granular configuration.
|
|
27
|
+
- **Template System Refactor**: Extracted large HTML/JS blocks into `src/git_graphable/templates.py` for improved maintainability.
|
|
28
|
+
- **Removed PlantUML Support**: Support for PlantUML has been removed in favor of more customizable engines (Mermaid, D2, HTML).
|
|
29
|
+
|
|
30
|
+
## [0.3.0] - 2026-03-05
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- **Customizable Visual Styling**: Full override of node and edge styles (colors, widths, dash patterns) via CLI (`--style`) and TOML (`[git-graphable.theme]`).
|
|
34
|
+
- **Configurable Hygiene Scoring**: Customization of hygiene penalties and caps via TOML (`[git-graphable.hygiene_weights]`).
|
|
35
|
+
- **Advanced Issue Tracker Integration**:
|
|
36
|
+
- **Longevity Mismatch**: Detection of large time gaps between ticket creation and the first commit.
|
|
37
|
+
- **Collaboration Gaps**: Highlighting when the Git author doesn't match the Issue Tracker assignee.
|
|
38
|
+
- **Release Validation**: Verification that "Released" tickets are tagged in Git.
|
|
39
|
+
- **New Documentation**: Added `STYLING.md` guide for visual customization.
|
|
40
|
+
- **Engine Consistency**: Unified styling logic across Mermaid, D2, and Graphviz engines.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
- **CLI Refactor**: Migrated to a more robust Typer/Rich implementation with enhanced command-line options.
|
|
44
|
+
- **Issue Engine**: Refactored `IssueTracker` to support richer metadata (assignees, timestamps).
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
- Fixed inconsistent color application in Mermaid graphs.
|
|
48
|
+
- Improved cleanup of temporary files during image export.
|
|
49
|
+
|
|
50
|
+
## [0.2.0] - 2026-03-04
|
|
51
|
+
- Initial functional release with basic Git hygiene scoring and GitHub/Jira integration.
|
|
@@ -77,7 +77,15 @@ lint:
|
|
|
77
77
|
|
|
78
78
|
[group('qa')]
|
|
79
79
|
@test *args:
|
|
80
|
-
uv run -m pytest --git-branch {{ GIT_BRANCH }} --git-commit {{ GIT_COMMIT }} --html-output htmlrep -n auto --should-open-report never {{ args }}
|
|
80
|
+
uv run -m pytest --git-branch {{ GIT_BRANCH }} --git-commit {{ GIT_COMMIT }} --html-output htmlrep -n auto --should-open-report never -m "not ui" {{ args }}
|
|
81
|
+
|
|
82
|
+
[group('qa')]
|
|
83
|
+
install-ui:
|
|
84
|
+
uv run --group ui playwright install chromium
|
|
85
|
+
|
|
86
|
+
[group('qa')]
|
|
87
|
+
@test-ui *args:
|
|
88
|
+
uv run --group ui -m pytest --git-branch {{ GIT_BRANCH }} --git-commit {{ GIT_COMMIT }} --html-output htmlrep -n 1 --should-open-report never -m "ui" {{ args }}
|
|
81
89
|
|
|
82
90
|
[group('qa')]
|
|
83
91
|
[group('view')]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-graphable
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A powerful Git history visualizer and hygiene linter with CI gating.
|
|
5
5
|
Project-URL: Homepage, https://github.com/TheTrueSCU/git-graphable
|
|
6
6
|
Project-URL: Issues, https://github.com/TheTrueSCU/git-graphable/issues
|
|
7
7
|
Project-URL: Repository, https://github.com/TheTrueSCU/git-graphable
|
|
8
8
|
Author-email: Richard West <dopplereffect.us@gmail.com>
|
|
9
|
-
Keywords: analysis,ci,d2,git,git-flow,github,graph,hygiene,lint,mermaid,topology,visualization
|
|
9
|
+
Keywords: analysis,automation,ci,cytoscape,d2,git,git-flow,github,github-actions,graph,html,hygiene,interactive,lint,mermaid,topology,visualization
|
|
10
10
|
Requires-Python: >=3.13
|
|
11
11
|
Requires-Dist: graphable>=0.6.0
|
|
12
12
|
Provides-Extra: cli
|
|
@@ -16,7 +16,7 @@ Description-Content-Type: text/markdown
|
|
|
16
16
|
|
|
17
17
|
# Git Graphable
|
|
18
18
|
|
|
19
|
-
A powerful Python tool to convert Git commit history into beautiful, interactive flowcharts using the `graphable` library. Supporting Mermaid, D2, Graphviz, and
|
|
19
|
+
A powerful Python tool to convert Git commit history into beautiful, interactive flowcharts using the `graphable` library. Supporting Mermaid, D2, Graphviz, and HTML.
|
|
20
20
|
|
|
21
21
|
## Git Plugin Support
|
|
22
22
|
When installed in your PATH, you can use this as a native Git plugin:
|
|
@@ -26,7 +26,7 @@ git graphable .
|
|
|
26
26
|
|
|
27
27
|
## Features
|
|
28
28
|
|
|
29
|
-
- **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or
|
|
29
|
+
- **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or HTML (.html).
|
|
30
30
|
- **Automatic Visualization**: Generates and opens an image (SVG/PNG) automatically if no output is specified.
|
|
31
31
|
- **Advanced Highlighting**: Visualize author patterns, topological distance, and specific merge paths.
|
|
32
32
|
- **GitHub Integration**: Highlight commits based on pull request status (Merged, Open, Closed, Draft) using the `gh` CLI.
|
|
@@ -53,16 +53,41 @@ For a complete reference of all command-line options, see the [USAGE.md](USAGE.m
|
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
# Basic usage (opens a Mermaid image)
|
|
56
|
-
uv run git-graphable .
|
|
56
|
+
uv run git-graphable analyze .
|
|
57
57
|
|
|
58
58
|
# Highlight PR status (requires gh CLI)
|
|
59
|
-
uv run git-graphable . --highlight-pr-status
|
|
59
|
+
uv run git-graphable analyze . --highlight-pr-status
|
|
60
60
|
|
|
61
61
|
# Specify an engine and output file
|
|
62
|
-
uv run git-graphable https://github.com/TheTrueSCU/graphable/ --engine d2 -o graph.svg
|
|
62
|
+
uv run git-graphable analyze https://github.com/TheTrueSCU/graphable/ --engine d2 -o graph.svg
|
|
63
|
+
|
|
64
|
+
# Initialize a default configuration file
|
|
65
|
+
uv run git-graphable init
|
|
63
66
|
|
|
64
67
|
# Simplify the graph (only show branches/tags)
|
|
65
|
-
uv run git-graphable . --simplify
|
|
68
|
+
uv run git-graphable analyze . --simplify
|
|
69
|
+
|
|
70
|
+
## GitHub Action
|
|
71
|
+
|
|
72
|
+
Git Graphable can be easily integrated into your GitHub workflows to automatically generate hygiene reports on every push or pull request.
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
jobs:
|
|
76
|
+
git-hygiene:
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/checkout@v4
|
|
80
|
+
with:
|
|
81
|
+
fetch-depth: 0 # Required to see full history
|
|
82
|
+
|
|
83
|
+
- name: Generate Git Graph Reports
|
|
84
|
+
uses: TheTrueSCU/git-graphable/.github/actions/git-graphable@v0.4.0
|
|
85
|
+
with:
|
|
86
|
+
production_branch: 'main'
|
|
87
|
+
output_dir: 'reports'
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The action generates a **simplified Mermaid summary** (for quick review) and a **full interactive HTML graph** (for deep-dive auditing), uploading them as workflow artifacts.
|
|
66
91
|
```
|
|
67
92
|
|
|
68
93
|
## Highlighting Options
|
|
@@ -71,12 +96,12 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
|
|
|
71
96
|
|
|
72
97
|
| Option | Target | Effect | Conflicts With |
|
|
73
98
|
| :--- | :--- | :--- | :--- |
|
|
74
|
-
| `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale
|
|
75
|
-
| `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale
|
|
76
|
-
| `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale
|
|
77
|
-
| `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance
|
|
78
|
-
| `--highlight-wip` | **Fill** | Yellow fill for WIP/TODO commits | Authors, PR Status, Distance, Stale |
|
|
99
|
+
| `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale |
|
|
100
|
+
| `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale |
|
|
101
|
+
| `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale |
|
|
102
|
+
| `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance |
|
|
79
103
|
| `--highlight-path` | **Edge** | Thick Orange edge connecting nodes | None |
|
|
104
|
+
| `--highlight-wip` | **Stroke/Fill** | Yellow highlight for WIP/TODO commits | None |
|
|
80
105
|
| `--highlight-critical` | **Stroke** | Thick Red Solid outline | None |
|
|
81
106
|
| `--highlight-diverging-from` | **Stroke** | Orange Dashed outline | None |
|
|
82
107
|
| `--highlight-orphans` | **Stroke** | Grey Dashed outline | None |
|
|
@@ -97,32 +122,38 @@ For a full reference of the default visual styles and how to customize them, see
|
|
|
97
122
|
### Hygiene Analysis
|
|
98
123
|
Identify problematic patterns like direct pushes to `main`, messy WIP commits, back-merges from `main`, or contributor silos:
|
|
99
124
|
```bash
|
|
100
|
-
uv run git-graphable . --highlight-direct-pushes --highlight-wip --highlight-squashed --highlight-back-merges --highlight-silos
|
|
125
|
+
uv run git-graphable analyze . --highlight-direct-pushes --highlight-wip --highlight-squashed --highlight-back-merges --highlight-silos
|
|
101
126
|
```
|
|
102
127
|
|
|
103
128
|
### PR Status Highlighting
|
|
104
129
|
View the current state of all PRs in your repository graph:
|
|
105
130
|
```bash
|
|
106
|
-
uv run git-graphable . --highlight-pr-status
|
|
131
|
+
uv run git-graphable analyze . --highlight-pr-status
|
|
107
132
|
```
|
|
108
133
|
|
|
109
134
|
### Divergence Analysis (Hygiene)
|
|
110
135
|
Highlight commits that exist in `main` but are missing from your feature branches:
|
|
111
136
|
```bash
|
|
112
|
-
uv run git-graphable . --highlight-diverging-from main
|
|
137
|
+
uv run git-graphable analyze . --highlight-diverging-from main
|
|
113
138
|
```
|
|
114
139
|
|
|
115
140
|
### Issue Tracker Integration
|
|
116
141
|
Flag mismatches between your code and your tickets:
|
|
117
142
|
```bash
|
|
118
|
-
uv run git-graphable . --highlight-issue-inconsistencies --issue-pattern "[A-Z]+-[0-9]+" --issue-engine jira --jira-url "https://your-org.atlassian.net"
|
|
143
|
+
uv run git-graphable analyze . --highlight-issue-inconsistencies --issue-pattern "[A-Z]+-[0-9]+" --issue-engine jira --jira-url "https://your-org.atlassian.net"
|
|
119
144
|
```
|
|
120
145
|
|
|
121
146
|
### Customizable Scoring & Styling
|
|
122
147
|
Adjust hygiene penalties and visual styles to match your team's workflow:
|
|
123
148
|
```bash
|
|
124
149
|
# Aggressive penalty for direct pushes and custom teal color for critical branches
|
|
125
|
-
uv run git-graphable . --check --penalty direct_push_penalty:50 --style critical:stroke:teal
|
|
150
|
+
uv run git-graphable analyze . --check --penalty direct_push_penalty:50 --style critical:stroke:teal
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Interactive HTML Viewer
|
|
154
|
+
Generate a self-contained HTML file with a searchable graph, details sidebar, and an interactive legend to live-toggle all highlight modes:
|
|
155
|
+
```bash
|
|
156
|
+
uv run git-graphable analyze . --engine html -o graph.html
|
|
126
157
|
```
|
|
127
158
|
|
|
128
159
|
## Configuration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Git Graphable
|
|
2
2
|
|
|
3
|
-
A powerful Python tool to convert Git commit history into beautiful, interactive flowcharts using the `graphable` library. Supporting Mermaid, D2, Graphviz, and
|
|
3
|
+
A powerful Python tool to convert Git commit history into beautiful, interactive flowcharts using the `graphable` library. Supporting Mermaid, D2, Graphviz, and HTML.
|
|
4
4
|
|
|
5
5
|
## Git Plugin Support
|
|
6
6
|
When installed in your PATH, you can use this as a native Git plugin:
|
|
@@ -10,7 +10,7 @@ git graphable .
|
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
13
|
-
- **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or
|
|
13
|
+
- **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or HTML (.html).
|
|
14
14
|
- **Automatic Visualization**: Generates and opens an image (SVG/PNG) automatically if no output is specified.
|
|
15
15
|
- **Advanced Highlighting**: Visualize author patterns, topological distance, and specific merge paths.
|
|
16
16
|
- **GitHub Integration**: Highlight commits based on pull request status (Merged, Open, Closed, Draft) using the `gh` CLI.
|
|
@@ -37,16 +37,41 @@ For a complete reference of all command-line options, see the [USAGE.md](USAGE.m
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# Basic usage (opens a Mermaid image)
|
|
40
|
-
uv run git-graphable .
|
|
40
|
+
uv run git-graphable analyze .
|
|
41
41
|
|
|
42
42
|
# Highlight PR status (requires gh CLI)
|
|
43
|
-
uv run git-graphable . --highlight-pr-status
|
|
43
|
+
uv run git-graphable analyze . --highlight-pr-status
|
|
44
44
|
|
|
45
45
|
# Specify an engine and output file
|
|
46
|
-
uv run git-graphable https://github.com/TheTrueSCU/graphable/ --engine d2 -o graph.svg
|
|
46
|
+
uv run git-graphable analyze https://github.com/TheTrueSCU/graphable/ --engine d2 -o graph.svg
|
|
47
|
+
|
|
48
|
+
# Initialize a default configuration file
|
|
49
|
+
uv run git-graphable init
|
|
47
50
|
|
|
48
51
|
# Simplify the graph (only show branches/tags)
|
|
49
|
-
uv run git-graphable . --simplify
|
|
52
|
+
uv run git-graphable analyze . --simplify
|
|
53
|
+
|
|
54
|
+
## GitHub Action
|
|
55
|
+
|
|
56
|
+
Git Graphable can be easily integrated into your GitHub workflows to automatically generate hygiene reports on every push or pull request.
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
jobs:
|
|
60
|
+
git-hygiene:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
with:
|
|
65
|
+
fetch-depth: 0 # Required to see full history
|
|
66
|
+
|
|
67
|
+
- name: Generate Git Graph Reports
|
|
68
|
+
uses: TheTrueSCU/git-graphable/.github/actions/git-graphable@v0.4.0
|
|
69
|
+
with:
|
|
70
|
+
production_branch: 'main'
|
|
71
|
+
output_dir: 'reports'
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The action generates a **simplified Mermaid summary** (for quick review) and a **full interactive HTML graph** (for deep-dive auditing), uploading them as workflow artifacts.
|
|
50
75
|
```
|
|
51
76
|
|
|
52
77
|
## Highlighting Options
|
|
@@ -55,12 +80,12 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
|
|
|
55
80
|
|
|
56
81
|
| Option | Target | Effect | Conflicts With |
|
|
57
82
|
| :--- | :--- | :--- | :--- |
|
|
58
|
-
| `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale
|
|
59
|
-
| `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale
|
|
60
|
-
| `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale
|
|
61
|
-
| `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance
|
|
62
|
-
| `--highlight-wip` | **Fill** | Yellow fill for WIP/TODO commits | Authors, PR Status, Distance, Stale |
|
|
83
|
+
| `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale |
|
|
84
|
+
| `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale |
|
|
85
|
+
| `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale |
|
|
86
|
+
| `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance |
|
|
63
87
|
| `--highlight-path` | **Edge** | Thick Orange edge connecting nodes | None |
|
|
88
|
+
| `--highlight-wip` | **Stroke/Fill** | Yellow highlight for WIP/TODO commits | None |
|
|
64
89
|
| `--highlight-critical` | **Stroke** | Thick Red Solid outline | None |
|
|
65
90
|
| `--highlight-diverging-from` | **Stroke** | Orange Dashed outline | None |
|
|
66
91
|
| `--highlight-orphans` | **Stroke** | Grey Dashed outline | None |
|
|
@@ -81,32 +106,38 @@ For a full reference of the default visual styles and how to customize them, see
|
|
|
81
106
|
### Hygiene Analysis
|
|
82
107
|
Identify problematic patterns like direct pushes to `main`, messy WIP commits, back-merges from `main`, or contributor silos:
|
|
83
108
|
```bash
|
|
84
|
-
uv run git-graphable . --highlight-direct-pushes --highlight-wip --highlight-squashed --highlight-back-merges --highlight-silos
|
|
109
|
+
uv run git-graphable analyze . --highlight-direct-pushes --highlight-wip --highlight-squashed --highlight-back-merges --highlight-silos
|
|
85
110
|
```
|
|
86
111
|
|
|
87
112
|
### PR Status Highlighting
|
|
88
113
|
View the current state of all PRs in your repository graph:
|
|
89
114
|
```bash
|
|
90
|
-
uv run git-graphable . --highlight-pr-status
|
|
115
|
+
uv run git-graphable analyze . --highlight-pr-status
|
|
91
116
|
```
|
|
92
117
|
|
|
93
118
|
### Divergence Analysis (Hygiene)
|
|
94
119
|
Highlight commits that exist in `main` but are missing from your feature branches:
|
|
95
120
|
```bash
|
|
96
|
-
uv run git-graphable . --highlight-diverging-from main
|
|
121
|
+
uv run git-graphable analyze . --highlight-diverging-from main
|
|
97
122
|
```
|
|
98
123
|
|
|
99
124
|
### Issue Tracker Integration
|
|
100
125
|
Flag mismatches between your code and your tickets:
|
|
101
126
|
```bash
|
|
102
|
-
uv run git-graphable . --highlight-issue-inconsistencies --issue-pattern "[A-Z]+-[0-9]+" --issue-engine jira --jira-url "https://your-org.atlassian.net"
|
|
127
|
+
uv run git-graphable analyze . --highlight-issue-inconsistencies --issue-pattern "[A-Z]+-[0-9]+" --issue-engine jira --jira-url "https://your-org.atlassian.net"
|
|
103
128
|
```
|
|
104
129
|
|
|
105
130
|
### Customizable Scoring & Styling
|
|
106
131
|
Adjust hygiene penalties and visual styles to match your team's workflow:
|
|
107
132
|
```bash
|
|
108
133
|
# Aggressive penalty for direct pushes and custom teal color for critical branches
|
|
109
|
-
uv run git-graphable . --check --penalty direct_push_penalty:50 --style critical:stroke:teal
|
|
134
|
+
uv run git-graphable analyze . --check --penalty direct_push_penalty:50 --style critical:stroke:teal
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Interactive HTML Viewer
|
|
138
|
+
Generate a self-contained HTML file with a searchable graph, details sidebar, and an interactive legend to live-toggle all highlight modes:
|
|
139
|
+
```bash
|
|
140
|
+
uv run git-graphable analyze . --engine html -o graph.html
|
|
110
141
|
```
|
|
111
142
|
|
|
112
143
|
## Configuration
|
|
@@ -10,13 +10,17 @@ These styles are applied to commit nodes based on their state or identified hygi
|
|
|
10
10
|
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
|
|
11
11
|
| **Critical** | `red` | - | `4` | `solid` | - | Thick Red Solid outline |
|
|
12
12
|
| **WIP** | - | `#ffff00` | - | - | - | Yellow background |
|
|
13
|
-
| **
|
|
13
|
+
| **Divergence** | `orange` | - | `2` | `dashed`| - | Orange Dashed outline |
|
|
14
14
|
| **Orphan** | `grey` | - | - | `dashed`| `0.6` | Faded Grey Dashed outline |
|
|
15
15
|
| **Long Running**| `purple` | - | `3` | `solid` | - | Purple Solid outline |
|
|
16
16
|
| **PR Conflict** | `red` | - | `6` | `solid` | - | Very Thick Red outline |
|
|
17
17
|
| **Direct Push** | `#ff0000` | - | `8` | `dashed`| - | Thickest Red Dashed outline |
|
|
18
18
|
| **Back Merge** | `orange` | - | `4` | `dashed`| - | Thick Orange Dashed outline |
|
|
19
19
|
| **Silo** | `blue` | - | `6` | `solid` | - | Thick Blue Solid outline |
|
|
20
|
+
| **Issue Desync** | `orange` | - | `4` | `solid` | - | Thick Orange outline |
|
|
21
|
+
| **Release Gap** | `red` | - | `2` | `dashed`| - | Red Dashed outline |
|
|
22
|
+
| **Collab Gap** | `purple` | - | `4` | `dotted`| - | Purple Dotted outline |
|
|
23
|
+
| **Longevity** | `brown` | - | `3` | `solid` | - | Brown Solid outline |
|
|
20
24
|
|
|
21
25
|
## PR Status Colors
|
|
22
26
|
|
|
@@ -118,3 +122,4 @@ fill = "#00FF00"
|
|
|
118
122
|
* **Mermaid**: Supports all properties. Width is mapped to `stroke-width`. Dash is mapped to `stroke-dasharray`.
|
|
119
123
|
* **D2**: Supports all properties. `double-border` is automatically enabled for Critical nodes.
|
|
120
124
|
* **Graphviz**: Supports all properties. `penwidth` is used for width. Dash is mapped to `style=dashed/dotted`.
|
|
125
|
+
* **HTML**: Supports all properties via Cytoscape.js.
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
# `git-graphable`
|
|
2
2
|
|
|
3
|
-
Git
|
|
3
|
+
Git history hygiene analyzer and visualizer.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
7
|
```console
|
|
8
|
-
$ git-graphable [
|
|
8
|
+
$ git-graphable [COMMAND] [ARGS]...
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
**Commands**:
|
|
12
|
+
|
|
13
|
+
* `analyze`: Analyze git history and generate a graph (default).
|
|
14
|
+
* `init`: Initialize a default `.git-graphable.toml` configuration file.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## `analyze`
|
|
19
|
+
|
|
20
|
+
Analyze git history and generate a graph. This is the default command; if no command is specified, `analyze` is assumed.
|
|
21
|
+
|
|
11
22
|
**Arguments**:
|
|
12
23
|
|
|
13
24
|
* `PATH`: Path to local directory or git URL [required]
|
|
@@ -17,9 +28,13 @@ $ git-graphable [OPTIONS] PATH
|
|
|
17
28
|
* `--config TEXT`: Path to TOML configuration file
|
|
18
29
|
* `--production-branch TEXT`: Production branch name (e.g. main, master)
|
|
19
30
|
* `--development-branch TEXT`: Development branch name (e.g. develop, main)
|
|
20
|
-
* `--date-format TEXT`: Date format for commit labels
|
|
21
|
-
* `--engine [mermaid|graphviz|d2|
|
|
22
|
-
*
|
|
31
|
+
* `--date-format TEXT`: Date format for commit labels
|
|
32
|
+
* `--engine [mermaid|graphviz|d2|html]`: Visualization engine.
|
|
33
|
+
* **mermaid**: Static text export (default).
|
|
34
|
+
* **graphviz**: Static text export.
|
|
35
|
+
* **d2**: Static text export.
|
|
36
|
+
* **html**: **Interactive HTML Viewer**. Generates a self-contained file with a searchable graph, details sidebar, and a **dynamic legend** to toggle all highlight modes on/off.
|
|
37
|
+
* `-o, --output TEXT`: Output file path. If no output is provided, a temporary file is created and opened automatically.
|
|
23
38
|
* `--image`: Export as image even when output path is provided
|
|
24
39
|
* `--simplify`: Pass --simplify-by-decoration to git log
|
|
25
40
|
* `--limit INTEGER`: Limit the number of commits to process
|
|
@@ -59,6 +74,16 @@ $ git-graphable [OPTIONS] PATH
|
|
|
59
74
|
* `--check`: Exit with non-zero if hygiene score is below threshold
|
|
60
75
|
* `--min-score INTEGER`: Minimum hygiene score required for --check
|
|
61
76
|
* `--bare`: Force bare mode (no rich output)
|
|
62
|
-
* `--
|
|
63
|
-
|
|
77
|
+
* `--help`: Show this message and exit.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## `init`
|
|
82
|
+
|
|
83
|
+
Initialize a default `.git-graphable.toml` configuration file.
|
|
84
|
+
|
|
85
|
+
**Options**:
|
|
86
|
+
|
|
87
|
+
* `-o, --output TEXT`: Path to create the config file [default: .git-graphable.toml]
|
|
88
|
+
* `-f, --force`: Overwrite existing config file
|
|
64
89
|
* `--help`: Show this message and exit.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Git Graphable Examples
|
|
2
2
|
|
|
3
|
-
This page demonstrates the visual output and hygiene analysis of `git-graphable` using generated example repositories.
|
|
3
|
+
This page demonstrates the visual output and hygiene analysis of `git-graphable analyze` using generated example repositories.
|
|
4
4
|
|
|
5
5
|
## 1. Pristine Repository (Score: 100%)
|
|
6
6
|
Demonstrates a clean, PR-based workflow with multi-author highlighting and critical branch marking.
|
|
7
7
|
|
|
8
8
|
**Command:**
|
|
9
9
|
```bash
|
|
10
|
-
git-graphable repo-pristine --highlight-critical --critical-branch main --highlight-authors
|
|
10
|
+
git-graphable analyze repo-pristine --highlight-critical --critical-branch main --highlight-authors
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
**Output:**
|
|
@@ -40,7 +40,7 @@ Demonstrates common hygiene issues: WIP commits, direct pushes to protected bran
|
|
|
40
40
|
|
|
41
41
|
**Command:**
|
|
42
42
|
```bash
|
|
43
|
-
git-graphable repo-messy --highlight-wip --highlight-direct-pushes --highlight-stale
|
|
43
|
+
git-graphable analyze repo-messy --highlight-wip --highlight-direct-pushes --highlight-stale
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
**Output:**
|
|
@@ -73,7 +73,7 @@ Highlights branches with many commits but only one contributor. This indicates a
|
|
|
73
73
|
|
|
74
74
|
**Command:**
|
|
75
75
|
```bash
|
|
76
|
-
git-graphable repo-risk-silo --highlight-silos --silo-threshold 20
|
|
76
|
+
git-graphable analyze repo-risk-silo --highlight-silos --silo-threshold 20
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
**Output:**
|
|
@@ -140,7 +140,7 @@ Highlights redundant back-merges.
|
|
|
140
140
|
|
|
141
141
|
**Command:**
|
|
142
142
|
```bash
|
|
143
|
-
git-graphable repo-complex-hygiene --highlight-back-merges
|
|
143
|
+
git-graphable analyze repo-complex-hygiene --highlight-back-merges
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
**Output:**
|
|
@@ -172,7 +172,7 @@ Highlights desyncs between Git and external trackers (Jira, GitHub Issues).
|
|
|
172
172
|
|
|
173
173
|
**Command:**
|
|
174
174
|
```bash
|
|
175
|
-
git-graphable repo-issue-desync --highlight-issue-inconsistencies --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo CLOSED"
|
|
175
|
+
git-graphable analyze repo-issue-desync --highlight-issue-inconsistencies --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo CLOSED"
|
|
176
176
|
```
|
|
177
177
|
|
|
178
178
|
**Output:**
|
|
@@ -190,7 +190,7 @@ Highlights issues marked as "Released" in the tracker but not yet reachable from
|
|
|
190
190
|
|
|
191
191
|
**Command:**
|
|
192
192
|
```bash
|
|
193
|
-
git-graphable repo-release-desync --highlight-release-inconsistencies --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo CLOSED"
|
|
193
|
+
git-graphable analyze repo-release-desync --highlight-release-inconsistencies --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo CLOSED"
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
**Output:**
|
|
@@ -210,7 +210,7 @@ Highlights when the Git commit author doesn't match the assigned issue owner in
|
|
|
210
210
|
|
|
211
211
|
**Command:**
|
|
212
212
|
```bash
|
|
213
|
-
git-graphable repo-collab-gap --highlight-collaboration-gaps --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo OPEN,Bob"
|
|
213
|
+
git-graphable analyze repo-collab-gap --highlight-collaboration-gaps --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo OPEN,Bob"
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
**Output:**
|
|
@@ -228,7 +228,7 @@ Demonstrates features like orphan/dangling commits and divergence.
|
|
|
228
228
|
|
|
229
229
|
**Command:**
|
|
230
230
|
```bash
|
|
231
|
-
git-graphable repo-features --highlight-orphans --highlight-diverging-from main
|
|
231
|
+
git-graphable analyze repo-features --highlight-orphans --highlight-diverging-from main
|
|
232
232
|
```
|
|
233
233
|
|
|
234
234
|
**Output:**
|
|
@@ -247,14 +247,32 @@ style ebeaa6afb7b85a2d84d8aa5279ca3ad50f54a987 stroke:orange,stroke-width:2px,st
|
|
|
247
247
|
---
|
|
248
248
|
|
|
249
249
|
## 9. CI Mode (Gating)
|
|
250
|
-
Demonstrates how to use `git-graphable` as a CI gate.
|
|
250
|
+
Demonstrates how to use `git-graphable analyze` as a CI gate.
|
|
251
251
|
|
|
252
252
|
**Command (Fails):**
|
|
253
253
|
```bash
|
|
254
|
-
git-graphable repo-messy --check --min-score 80 --
|
|
254
|
+
git-graphable analyze repo-messy --check --min-score 80 --highlight-wip --highlight-direct-pushes
|
|
255
255
|
```
|
|
256
256
|
|
|
257
257
|
**Output:**
|
|
258
258
|
```text
|
|
259
259
|
Error: Hygiene score 76% is below required 80%
|
|
260
260
|
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 10. Interactive HTML Viewer
|
|
265
|
+
The HTML engine produces a self-contained, interactive visualization with a live-toggle legend.
|
|
266
|
+
|
|
267
|
+
**Command:**
|
|
268
|
+
```bash
|
|
269
|
+
git-graphable analyze repo-messy --engine html -o graph.html
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Key Features:**
|
|
273
|
+
- **Live Legend**: Toggle hygiene overlays (WIP, Direct Push, Divergence) on/off.
|
|
274
|
+
- **Color Modes**: Switch between Authors, PR Status, Distance, and Staleness views.
|
|
275
|
+
- **Searchable**: Find specific commits by hash or message.
|
|
276
|
+
- **Hierarchical Layout**: Powered by Dagre for a clean top-down flow.
|
|
277
|
+
- **Details Sidebar**: View full commit metadata upon selection.
|
|
278
|
+
|