]> git.ipfire.org Git - thirdparty/git.git/commit
graph: limit the graph width to a hard-coded max
authorPablo Sabater <pabloosabaterr@gmail.com>
Sat, 28 Mar 2026 00:11:11 +0000 (01:11 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Mar 2026 04:22:08 +0000 (21:22 -0700)
commitb2faaaec1193c64f7366e26a569ca6e231cbd478
tree17127b0c826da20a7d1d809ecde71ed39e249c3f
parent6e8d538aab8fe4dd07ba9fb87b5c7edcfa5706ad
graph: limit the graph width to a hard-coded max

Repositories that have many active branches at the same time
produce wide graphs. A lane consists of two columns, the edge and the
padding (or another edge), each branch takes a lane in the graph and
there is no way to limit how many can be shown.

Limit the graph engine to draw at most 15 lanes. Lanes over the limit are
not rendered.

On the commit line, if the commit lives on a visible lane, show the
normal commit mark and stop rendering. If the commit lives on the
first hidden lane, show the "*" commit mark so it is known that
this commit lives in the first hidden lane. Commits on deeper lanes
aren't rendered, but the commit subject will always remain.

For merges, the post-merge lane is only needed when the commit or
the first parent lives on a visible lane (to draw the connection
between them), when both are on hidden lanes, post-merge carries
no useful information, skip it and go to collapsing or padding state.

Also fix a pre-existing indentation issue.

The hard-coded limit will be replaced by a user-facing option
on a subsequent commit.

Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
graph.c