Skip to content

Commit graph is visually misleading near branch tips (branch divergence unclear) #5497

Open

Description

@zhfwch

Description

The commit graph in lazygit can be visually misleading near branch tips, especially when multiple branches are present.

While the underlying commit DAG is correct, the combination of column reuse and branch label placement can make it appear as if a branch diverged from an incorrect commit.

This is confusing when trying to understand where a branch was created.


Example

In my case:

  • bugfix/logger was created from main at commit 3b69e3cc
  • However, in lazygit, the graph visually suggests that it might have diverged from a much older commit (due to a continuous vertical line)

The lower part of the graph is correct and easy to read, but near the branch tip the visualization becomes misleading.

Image Image

Expected behavior

The graph should make branch divergence clearer, or at least avoid visual artifacts that suggest incorrect ancestry.

Possible improvements:

  • Make branch divergence points more explicit
  • Avoid column reuse near branch tips when it causes ambiguity
  • Provide an optional "branch-aware" graph mode (similar to GitHub/Fork)

Actual behavior

  • Commit relationships are correct
  • But visually, the branch appears to be connected to the wrong ancestor due to column reuse

Screenshots

(attach your lazygit screenshot here)


Additional context

This seems related to how the graph layout prioritizes compactness over clarity.

Similar confusion has been reported in issues like:


Thanks for the great tool! This is just a UX improvement suggestion.

Activity

  1. seflue commented on Sep 25, 2026

    @seflue
    Contributor

    I ran into this as well. It shows up when a branch forks off a merge commit. In the merge's row, the branch's line ends in some column, and the merge's line to its second parent starts in the same column. Both land in one cell and render as a straight │. The branch then seems to sit on the merge's second parent:

    ◎─╮      merge feature-a
    │ ○      a1              parent: base
    ◎─│─╮    merge feature-b
    │ │ ○    b1              parent: base
    ◎─│─╯    base (a merge)
    │ ○      x1              looks like a1's parent
    ○─╯
    

    I've fixed it on my fork without changing the layout, see draft PR #6060. Without a selection, the lines from a merge's children into the merge take priority and stay connected:

    ◎─│─╮    merge feature-b
    │ │ ○    b1
    ◎─┴─╯    base
    │ ○      x1
    ○─╯
    

    The gap leaves open which commit x1 was merged into, but no line points at the wrong commit anymore.

    A selected commit's lines are drawn on top, without crossings. The merge's connection to its second parent is only shown when the merge is selected, as with base here. Selecting b1 runs its line to base over a1's, and selecting a1 ends its line with a curve next to b1's:

    base selected         b1 selected           a1 selected
    │ ○     a1            │ ○     a1            │ ○     a1
    ◎─│─╮                 ◎─│─╮                 ◎─│─╮
    │ │ ○   b1            │ │ ○   b1            │ │ ○   b1
    ◎─╮─╯   base          ◎───╯   base          ◎─╯─╯   base
    │ ○     x1            │ ○     x1            │ ○     x1
    ○─╯                   ○─╯                   ○─╯
    

    This also fixes #4246. On master, selecting merge feature-b cuts a1's and b1's lines off from base (◎ │─╯). On the branch they stay connected (◎─┴─╯ if a1 and b1 share an author, ◎─╯─╯ otherwise).

    main                      branch
    ○        t0               ○        t0
    │ ○      a1   (alice)     │ ○      a1   (alice)
    │ │ ○    b1   (bob)       │ │ ○    b1   (bob)
    ○─┴─╯    base             ○─╯─╯    base
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions