git-graphable 0.2.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.
Files changed (63) hide show
  1. git_graphable-0.4.0/.github/actions/git-graphable/action.yml +76 -0
  2. {git_graphable-0.2.0 → git_graphable-0.4.0}/.github/workflows/ci.yml +8 -0
  3. git_graphable-0.4.0/CHANGELOG.md +51 -0
  4. {git_graphable-0.2.0 → git_graphable-0.4.0}/Justfile +13 -2
  5. {git_graphable-0.2.0 → git_graphable-0.4.0}/PKG-INFO +93 -37
  6. {git_graphable-0.2.0 → git_graphable-0.4.0}/README.md +91 -35
  7. git_graphable-0.4.0/STYLING.md +125 -0
  8. git_graphable-0.4.0/USAGE.md +89 -0
  9. {git_graphable-0.2.0 → git_graphable-0.4.0}/examples/EXAMPLES.md +83 -26
  10. {git_graphable-0.2.0 → git_graphable-0.4.0}/examples/generate_demos.py +50 -0
  11. git_graphable-0.4.0/graph.html +573 -0
  12. {git_graphable-0.2.0 → git_graphable-0.4.0}/pyproject.toml +15 -1
  13. git_graphable-0.4.0/report_output/final_report.json +34 -0
  14. git_graphable-0.4.0/report_output/plus_metadata.json +8 -0
  15. git_graphable-0.4.0/report_output/report.html +700 -0
  16. git_graphable-0.4.0/report_output/screenshots/test_interactivity_toggling_chromium__failure.png +0 -0
  17. git_graphable-0.4.0/src/git_graphable/bare_cli.py +329 -0
  18. git_graphable-0.4.0/src/git_graphable/cli.py +29 -0
  19. git_graphable-0.4.0/src/git_graphable/cli_utils.py +17 -0
  20. {git_graphable-0.2.0 → git_graphable-0.4.0}/src/git_graphable/commands.py +54 -15
  21. git_graphable-0.4.0/src/git_graphable/core.py +402 -0
  22. git_graphable-0.4.0/src/git_graphable/default_config.toml +54 -0
  23. {git_graphable-0.2.0 → git_graphable-0.4.0}/src/git_graphable/highlighter.py +296 -131
  24. git_graphable-0.4.0/src/git_graphable/hygiene.py +228 -0
  25. git_graphable-0.4.0/src/git_graphable/issues.py +177 -0
  26. {git_graphable-0.2.0 → git_graphable-0.4.0}/src/git_graphable/models.py +4 -0
  27. {git_graphable-0.2.0 → git_graphable-0.4.0}/src/git_graphable/parser.py +46 -25
  28. git_graphable-0.4.0/src/git_graphable/rich_cli.py +348 -0
  29. git_graphable-0.4.0/src/git_graphable/styler.py +709 -0
  30. git_graphable-0.4.0/src/git_graphable/templates.py +137 -0
  31. git_graphable-0.4.0/tests/test_bare_cli.py +88 -0
  32. git_graphable-0.4.0/tests/test_cli.py +30 -0
  33. git_graphable-0.4.0/tests/test_cli_utils.py +16 -0
  34. git_graphable-0.4.0/tests/test_examples_html.py +110 -0
  35. {git_graphable-0.2.0 → git_graphable-0.4.0}/tests/test_highlighter.py +1 -1
  36. {git_graphable-0.2.0 → git_graphable-0.4.0}/tests/test_hygiene.py +260 -4
  37. git_graphable-0.4.0/tests/test_interactive_html.py +120 -0
  38. git_graphable-0.4.0/tests/test_issues.py +42 -0
  39. git_graphable-0.4.0/tests/test_parser.py +93 -0
  40. git_graphable-0.4.0/tests/test_rich_cli.py +99 -0
  41. {git_graphable-0.2.0 → git_graphable-0.4.0}/tests/test_styler.py +1 -2
  42. git_graphable-0.4.0/tests/test_ui_interactive.py +95 -0
  43. {git_graphable-0.2.0 → git_graphable-0.4.0}/uv.lock +132 -1
  44. git_graphable-0.2.0/USAGE.md +0 -52
  45. git_graphable-0.2.0/src/git_graphable/cli.py +0 -658
  46. git_graphable-0.2.0/src/git_graphable/core.py +0 -229
  47. git_graphable-0.2.0/src/git_graphable/hygiene.py +0 -139
  48. git_graphable-0.2.0/src/git_graphable/styler.py +0 -355
  49. git_graphable-0.2.0/tests/test_cli.py +0 -137
  50. git_graphable-0.2.0/tests/test_parser.py +0 -43
  51. {git_graphable-0.2.0 → git_graphable-0.4.0}/.gemini/GEMINI.md +0 -0
  52. {git_graphable-0.2.0 → git_graphable-0.4.0}/.gemini/code-ordering.md +0 -0
  53. {git_graphable-0.2.0 → git_graphable-0.4.0}/.github/dependabot.yml +0 -0
  54. {git_graphable-0.2.0 → git_graphable-0.4.0}/.github/workflows/publish.yml +0 -0
  55. {git_graphable-0.2.0 → git_graphable-0.4.0}/.gitignore +0 -0
  56. {git_graphable-0.2.0 → git_graphable-0.4.0}/.python-version +0 -0
  57. {git_graphable-0.2.0 → git_graphable-0.4.0}/SECURITY.md +0 -0
  58. {git_graphable-0.2.0 → git_graphable-0.4.0}/src/git_graphable/__init__.py +0 -0
  59. {git_graphable-0.2.0 → git_graphable-0.4.0}/src/git_graphable/github.py +0 -0
  60. {git_graphable-0.2.0 → git_graphable-0.4.0}/tests/test_config.py +0 -0
  61. {git_graphable-0.2.0 → git_graphable-0.4.0}/tests/test_core.py +0 -0
  62. {git_graphable-0.2.0 → git_graphable-0.4.0}/tests/test_github.py +0 -0
  63. {git_graphable-0.2.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.
@@ -58,7 +58,7 @@ publish: build
58
58
 
59
59
  [group('qa')]
60
60
  check: lint typing coverage
61
- uv run git-graphable . --check --min-score 80 --bare --highlight-wip --highlight-direct-pushes
61
+ uv run git-graphable . --check --min-score 75 --bare --highlight-wip --highlight-direct-pushes
62
62
 
63
63
  [group('qa')]
64
64
  @coverage *args:
@@ -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')]
@@ -112,3 +120,6 @@ generate-examples:
112
120
  uv run git-graphable examples/repos/repo-features --engine mermaid -o examples/assets/features.mmd --highlight-orphans --highlight-diverging-from main --bare
113
121
  uv run git-graphable examples/repos/repo-risk-silo --engine mermaid -o examples/assets/silo.mmd --highlight-silos --silo-threshold 20 --bare
114
122
  uv run git-graphable examples/repos/repo-complex-hygiene --engine mermaid -o examples/assets/complex.mmd --highlight-back-merges --bare
123
+ uv run git-graphable examples/repos/repo-issue-desync --engine mermaid -o examples/assets/issue_desync.mmd --highlight-issue-inconsistencies --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo CLOSED" --bare
124
+ uv run git-graphable examples/repos/repo-release-desync --engine mermaid -o examples/assets/release_desync.mmd --highlight-release-inconsistencies --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo CLOSED" --bare
125
+ uv run git-graphable examples/repos/repo-collab-gap --engine mermaid -o examples/assets/collab_gap.mmd --highlight-collaboration-gaps --issue-pattern "PROJ-[0-9]+" --issue-engine script --issue-script "echo OPEN,Bob" --bare
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-graphable
3
- Version: 0.2.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 PlantUML.
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,12 +26,16 @@ git graphable .
26
26
 
27
27
  ## Features
28
28
 
29
- - **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or PlantUML (.puml).
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.
33
33
  - **Hygiene Analysis**: Automatically detect WIP commits, direct pushes to protected branches, squashed PRs, back-merges, and contributor silos.
34
+ - **Issue Tracker Integration**: Connect to Jira, GitHub Issues, or custom scripts to highlight status desyncs.
35
+ - **Release & Assignment Validation**: Verify that "Released" tickets are actually tagged in Git and that commit authors match ticket assignees.
34
36
  - **Health Scoring**: Get a numeric "Hygiene Score" (0-100%) with a color-coded grade and detailed breakdown of workflow anti-patterns.
37
+ - **Visual Customization**: Fully customize colors, widths, and line styles for nodes and edges. See [STYLING.md](STYLING.md).
38
+ - **Configurable Penalties**: Fully customize the scoring logic by adjusting penalties and caps for each metric.
35
39
  - **CI Gating**: Use the `--check` flag to return a non-zero exit code if the hygiene score falls below a threshold (configurable via `--min-score`).
36
40
  - **Flexible Input**: Works with local repository paths or remote Git URLs.
37
41
  - **Dual CLI**: Modern Rich/Typer interface with a robust argparse fallback for bare environments.
@@ -49,16 +53,41 @@ For a complete reference of all command-line options, see the [USAGE.md](USAGE.m
49
53
 
50
54
  ```bash
51
55
  # Basic usage (opens a Mermaid image)
52
- uv run git-graphable .
56
+ uv run git-graphable analyze .
53
57
 
54
58
  # Highlight PR status (requires gh CLI)
55
- uv run git-graphable . --highlight-pr-status
59
+ uv run git-graphable analyze . --highlight-pr-status
56
60
 
57
61
  # Specify an engine and output file
58
- 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
59
66
 
60
67
  # Simplify the graph (only show branches/tags)
61
- 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.
62
91
  ```
63
92
 
64
93
  ## Highlighting Options
@@ -67,12 +96,12 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
67
96
 
68
97
  | Option | Target | Effect | Conflicts With |
69
98
  | :--- | :--- | :--- | :--- |
70
- | `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale, WIP |
71
- | `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale, WIP |
72
- | `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale, WIP |
73
- | `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance, WIP |
74
- | `--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 |
75
103
  | `--highlight-path` | **Edge** | Thick Orange edge connecting nodes | None |
104
+ | `--highlight-wip` | **Stroke/Fill** | Yellow highlight for WIP/TODO commits | None |
76
105
  | `--highlight-critical` | **Stroke** | Thick Red Solid outline | None |
77
106
  | `--highlight-diverging-from` | **Stroke** | Orange Dashed outline | None |
78
107
  | `--highlight-orphans` | **Stroke** | Grey Dashed outline | None |
@@ -81,48 +110,56 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
81
110
  | `--highlight-squashed` | **Stroke/Edge** | Grey Solid outline and dashed Grey logical merge edge | None |
82
111
  | `--highlight-back-merges` | **Stroke** | Orange Dashed outline | None |
83
112
  | `--highlight-silos` | **Stroke** | Blue Solid outline | None |
113
+ | `--highlight-issue-inconsistencies` | **Label** | Adds `[ISSUE-DESYNC]` label | None |
114
+ | `--highlight-release-inconsistencies`| **Label** | Adds `[NOT-RELEASED]` label | None |
115
+ | `--highlight-collaboration-gaps` | **Label** | Adds `[COLLAB-GAP]` label | None |
116
+ | `--highlight-longevity-mismatch` | **Label** | Adds `[LONGEVITY]` label | None |
84
117
 
85
- ### Highlighting Priorities
86
- - **Fill**: `--highlight-authors`, `--highlight-pr-status`, `--highlight-distance-from`, `--highlight-stale`, and `--highlight-wip` are mutually exclusive.
87
- - **Edge**: Path highlighting (Thick Orange) takes priority over Long-Running highlighting (Thick Purple), which takes priority over Logical Squashed Merges (Dashed Grey).
88
- - **Stroke**: Critical outlines (Thick Red Solid) take priority over Direct Pushes (Thick Red Dashed), which take priority over PR Conflicts (Thick Red Solid), which take priority over Back-Merges (Orange Dashed), which take priority over Squash Commits (Grey Solid), which take priority over Contributor Silos (Blue Solid), which take priority over all other outlines (Divergence, Orphan, Long-Running).
118
+ For a full reference of the default visual styles and how to customize them, see [STYLING.md](STYLING.md).
89
119
 
90
120
  ## Advanced Examples
91
121
 
92
122
  ### Hygiene Analysis
93
123
  Identify problematic patterns like direct pushes to `main`, messy WIP commits, back-merges from `main`, or contributor silos:
94
124
  ```bash
95
- 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
96
126
  ```
97
127
 
98
128
  ### PR Status Highlighting
99
129
  View the current state of all PRs in your repository graph:
100
130
  ```bash
101
- uv run git-graphable . --highlight-pr-status
131
+ uv run git-graphable analyze . --highlight-pr-status
102
132
  ```
103
133
 
104
134
  ### Divergence Analysis (Hygiene)
105
135
  Highlight commits that exist in `main` but are missing from your feature branches:
106
136
  ```bash
107
- uv run git-graphable . --highlight-diverging-from main
137
+ uv run git-graphable analyze . --highlight-diverging-from main
108
138
  ```
109
139
 
110
- ### Large Repositories
111
- For repositories with long histories, use the `--limit` flag to keep the graph readable and avoid engine rendering limits:
140
+ ### Issue Tracker Integration
141
+ Flag mismatches between your code and your tickets:
112
142
  ```bash
113
- uv run git-graphable . --limit 100 --highlight-authors
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"
144
+ ```
145
+
146
+ ### Customizable Scoring & Styling
147
+ Adjust hygiene penalties and visual styles to match your team's workflow:
148
+ ```bash
149
+ # Aggressive penalty for direct pushes and custom teal color for critical branches
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
114
157
  ```
115
158
 
116
159
  ## Configuration
117
160
 
118
161
  Git Graphable can be configured via a TOML file (`.git-graphable.toml` or `pyproject.toml`). CLI flags always take precedence over configuration file settings.
119
162
 
120
- ### Configuration Locations
121
- The tool searches for configuration in the following order:
122
- 1. File specified via `--config <path>`
123
- 2. `.git-graphable.toml` in the repository root
124
- 3. `pyproject.toml` in the repository root (under `[tool.git-graphable]`)
125
-
126
163
  ### Example `.git-graphable.toml`
127
164
  ```toml
128
165
  [git-graphable]
@@ -142,15 +179,34 @@ highlight_back_merges = true
142
179
  highlight_silos = true
143
180
  silo_commit_threshold = 20
144
181
  silo_author_count = 1
145
- min_hygiene_score = 80
146
- ```
147
182
 
148
- ### Example `pyproject.toml`
149
- ```toml
150
- [tool.git-graphable]
151
- development_branch = "main"
152
- simplify = true
153
- highlight_authors = true
183
+ # Issue Tracker
184
+ highlight_issue_inconsistencies = true
185
+ highlight_release_inconsistencies = true
186
+ highlight_collaboration_gaps = true
187
+ highlight_longevity_mismatch = true
188
+ issue_pattern = "JIRA-[0-9]+"
189
+ issue_engine = "jira"
190
+ jira_url = "https://your-org.atlassian.net"
191
+ jira_closed_statuses = ["Done", "Closed", "Resolved"]
192
+ released_statuses = ["Released"]
193
+ author_mapping = { "Git Name" = "Jira Name" }
194
+ longevity_threshold_days = 14
195
+
196
+ # Custom Scoring
197
+ [git-graphable.hygiene_weights]
198
+ direct_push_penalty = 25
199
+ direct_push_cap = 75
200
+ wip_commit_penalty = 5
201
+
202
+ # Custom Theme
203
+ [git-graphable.theme.critical]
204
+ stroke = "teal"
205
+ width = 2
206
+
207
+ [git-graphable.theme.direct_push]
208
+ stroke = "magenta"
209
+ dash = "dotted"
154
210
  ```
155
211
 
156
212
  ## Development
@@ -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 PlantUML.
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,12 +10,16 @@ git graphable .
10
10
 
11
11
  ## Features
12
12
 
13
- - **Multi-Engine Support**: Export to Mermaid (.mmd), D2 (.d2), Graphviz (.dot), or PlantUML (.puml).
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.
17
17
  - **Hygiene Analysis**: Automatically detect WIP commits, direct pushes to protected branches, squashed PRs, back-merges, and contributor silos.
18
+ - **Issue Tracker Integration**: Connect to Jira, GitHub Issues, or custom scripts to highlight status desyncs.
19
+ - **Release & Assignment Validation**: Verify that "Released" tickets are actually tagged in Git and that commit authors match ticket assignees.
18
20
  - **Health Scoring**: Get a numeric "Hygiene Score" (0-100%) with a color-coded grade and detailed breakdown of workflow anti-patterns.
21
+ - **Visual Customization**: Fully customize colors, widths, and line styles for nodes and edges. See [STYLING.md](STYLING.md).
22
+ - **Configurable Penalties**: Fully customize the scoring logic by adjusting penalties and caps for each metric.
19
23
  - **CI Gating**: Use the `--check` flag to return a non-zero exit code if the hygiene score falls below a threshold (configurable via `--min-score`).
20
24
  - **Flexible Input**: Works with local repository paths or remote Git URLs.
21
25
  - **Dual CLI**: Modern Rich/Typer interface with a robust argparse fallback for bare environments.
@@ -33,16 +37,41 @@ For a complete reference of all command-line options, see the [USAGE.md](USAGE.m
33
37
 
34
38
  ```bash
35
39
  # Basic usage (opens a Mermaid image)
36
- uv run git-graphable .
40
+ uv run git-graphable analyze .
37
41
 
38
42
  # Highlight PR status (requires gh CLI)
39
- uv run git-graphable . --highlight-pr-status
43
+ uv run git-graphable analyze . --highlight-pr-status
40
44
 
41
45
  # Specify an engine and output file
42
- 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
43
50
 
44
51
  # Simplify the graph (only show branches/tags)
45
- 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.
46
75
  ```
47
76
 
48
77
  ## Highlighting Options
@@ -51,12 +80,12 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
51
80
 
52
81
  | Option | Target | Effect | Conflicts With |
53
82
  | :--- | :--- | :--- | :--- |
54
- | `--highlight-authors` | **Fill** | Unique color per author | PR Status, Distance, Stale, WIP |
55
- | `--highlight-pr-status` | **Fill/Stroke**| Color by PR state (Merged=Purple, Open=Green) | Authors, Distance, Stale, WIP |
56
- | `--highlight-distance-from` | **Fill** | Blue gradient fading by distance | Authors, PR Status, Stale, WIP |
57
- | `--highlight-stale` | **Fill** | Gradient white to red by age | Authors, PR Status, Distance, WIP |
58
- | `--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 |
59
87
  | `--highlight-path` | **Edge** | Thick Orange edge connecting nodes | None |
88
+ | `--highlight-wip` | **Stroke/Fill** | Yellow highlight for WIP/TODO commits | None |
60
89
  | `--highlight-critical` | **Stroke** | Thick Red Solid outline | None |
61
90
  | `--highlight-diverging-from` | **Stroke** | Orange Dashed outline | None |
62
91
  | `--highlight-orphans` | **Stroke** | Grey Dashed outline | None |
@@ -65,48 +94,56 @@ Git Graphable provides several ways to highlight commits and relationships. Mult
65
94
  | `--highlight-squashed` | **Stroke/Edge** | Grey Solid outline and dashed Grey logical merge edge | None |
66
95
  | `--highlight-back-merges` | **Stroke** | Orange Dashed outline | None |
67
96
  | `--highlight-silos` | **Stroke** | Blue Solid outline | None |
97
+ | `--highlight-issue-inconsistencies` | **Label** | Adds `[ISSUE-DESYNC]` label | None |
98
+ | `--highlight-release-inconsistencies`| **Label** | Adds `[NOT-RELEASED]` label | None |
99
+ | `--highlight-collaboration-gaps` | **Label** | Adds `[COLLAB-GAP]` label | None |
100
+ | `--highlight-longevity-mismatch` | **Label** | Adds `[LONGEVITY]` label | None |
68
101
 
69
- ### Highlighting Priorities
70
- - **Fill**: `--highlight-authors`, `--highlight-pr-status`, `--highlight-distance-from`, `--highlight-stale`, and `--highlight-wip` are mutually exclusive.
71
- - **Edge**: Path highlighting (Thick Orange) takes priority over Long-Running highlighting (Thick Purple), which takes priority over Logical Squashed Merges (Dashed Grey).
72
- - **Stroke**: Critical outlines (Thick Red Solid) take priority over Direct Pushes (Thick Red Dashed), which take priority over PR Conflicts (Thick Red Solid), which take priority over Back-Merges (Orange Dashed), which take priority over Squash Commits (Grey Solid), which take priority over Contributor Silos (Blue Solid), which take priority over all other outlines (Divergence, Orphan, Long-Running).
102
+ For a full reference of the default visual styles and how to customize them, see [STYLING.md](STYLING.md).
73
103
 
74
104
  ## Advanced Examples
75
105
 
76
106
  ### Hygiene Analysis
77
107
  Identify problematic patterns like direct pushes to `main`, messy WIP commits, back-merges from `main`, or contributor silos:
78
108
  ```bash
79
- 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
80
110
  ```
81
111
 
82
112
  ### PR Status Highlighting
83
113
  View the current state of all PRs in your repository graph:
84
114
  ```bash
85
- uv run git-graphable . --highlight-pr-status
115
+ uv run git-graphable analyze . --highlight-pr-status
86
116
  ```
87
117
 
88
118
  ### Divergence Analysis (Hygiene)
89
119
  Highlight commits that exist in `main` but are missing from your feature branches:
90
120
  ```bash
91
- uv run git-graphable . --highlight-diverging-from main
121
+ uv run git-graphable analyze . --highlight-diverging-from main
92
122
  ```
93
123
 
94
- ### Large Repositories
95
- For repositories with long histories, use the `--limit` flag to keep the graph readable and avoid engine rendering limits:
124
+ ### Issue Tracker Integration
125
+ Flag mismatches between your code and your tickets:
96
126
  ```bash
97
- uv run git-graphable . --limit 100 --highlight-authors
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"
128
+ ```
129
+
130
+ ### Customizable Scoring & Styling
131
+ Adjust hygiene penalties and visual styles to match your team's workflow:
132
+ ```bash
133
+ # Aggressive penalty for direct pushes and custom teal color for critical branches
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
98
141
  ```
99
142
 
100
143
  ## Configuration
101
144
 
102
145
  Git Graphable can be configured via a TOML file (`.git-graphable.toml` or `pyproject.toml`). CLI flags always take precedence over configuration file settings.
103
146
 
104
- ### Configuration Locations
105
- The tool searches for configuration in the following order:
106
- 1. File specified via `--config <path>`
107
- 2. `.git-graphable.toml` in the repository root
108
- 3. `pyproject.toml` in the repository root (under `[tool.git-graphable]`)
109
-
110
147
  ### Example `.git-graphable.toml`
111
148
  ```toml
112
149
  [git-graphable]
@@ -126,15 +163,34 @@ highlight_back_merges = true
126
163
  highlight_silos = true
127
164
  silo_commit_threshold = 20
128
165
  silo_author_count = 1
129
- min_hygiene_score = 80
130
- ```
131
166
 
132
- ### Example `pyproject.toml`
133
- ```toml
134
- [tool.git-graphable]
135
- development_branch = "main"
136
- simplify = true
137
- highlight_authors = true
167
+ # Issue Tracker
168
+ highlight_issue_inconsistencies = true
169
+ highlight_release_inconsistencies = true
170
+ highlight_collaboration_gaps = true
171
+ highlight_longevity_mismatch = true
172
+ issue_pattern = "JIRA-[0-9]+"
173
+ issue_engine = "jira"
174
+ jira_url = "https://your-org.atlassian.net"
175
+ jira_closed_statuses = ["Done", "Closed", "Resolved"]
176
+ released_statuses = ["Released"]
177
+ author_mapping = { "Git Name" = "Jira Name" }
178
+ longevity_threshold_days = 14
179
+
180
+ # Custom Scoring
181
+ [git-graphable.hygiene_weights]
182
+ direct_push_penalty = 25
183
+ direct_push_cap = 75
184
+ wip_commit_penalty = 5
185
+
186
+ # Custom Theme
187
+ [git-graphable.theme.critical]
188
+ stroke = "teal"
189
+ width = 2
190
+
191
+ [git-graphable.theme.direct_push]
192
+ stroke = "magenta"
193
+ dash = "dotted"
138
194
  ```
139
195
 
140
196
  ## Development