jojo/services/repository/gitgraph
Bram Hagens 60fb59a7a0 fix: display orphan branches separately in commit graph (#10484)
Fixes #2705.
Fixes #7635.

This PR fixes the commit graph showing false connections for orphan/root commits. Connection lines are now shown only when a parent/child relationship exists. Visible relationships are determined using `git log`'s `%P` output by the new `ComputeGlyphConnectivity` function. The SVG template is adapted to render vertical lines conditionally.

Unit tests for `ComputeGlyphConnectivity` cover regular linear commit history, orphan commits, merge commits, and non-commit glyphs (`|`, `/`, `\`). Unit tests also cover the changes to the `git log` parsing. The SVG template was verified manually.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10484
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Bram Hagens <bram@bramh.me>
Co-committed-by: Bram Hagens <bram@bramh.me>
2025-12-29 02:53:54 +01:00
..
graph.go fix: display orphan branches separately in commit graph (#10484) 2025-12-29 02:53:54 +01:00
graph_models.go fix: display orphan branches separately in commit graph (#10484) 2025-12-29 02:53:54 +01:00
graph_test.go fix: display orphan branches separately in commit graph (#10484) 2025-12-29 02:53:54 +01:00
parser.go fix: display orphan branches separately in commit graph (#10484) 2025-12-29 02:53:54 +01:00