Re: [PATCH v9 0/4] graph: indent visual roots in graph
- From
Pablo Sabater <pabloosabaterr@gmail.com>
- Date
- Jul 11, 2026, 15:41 UTC
- Message-ID
- <DJVUU76PUXR4.2BYRTA8SEEBVC@gmail.com>
- In-Reply-To
- <alJOgYmAfGg37hsB@exploit>
On Sat Jul 11, 2026 at 4:15 PM CEST, Mirko Faina wrote:
Show 10 quoted lines
> On Sat, Jul 11, 2026 at 03:37:49PM +0200, Pablo Sabater wrote: >> When rendering a graph, if the history contains multiple "visual roots", >> actual roots or commits that look like roots (i.e. have their parents >> filtered out) can end up being vertically adjacent to unrelated commits, >> falsely appearing to be related. >> >> A fix for this issue was already attempted [1] a while ago. >> >> This series adds indentation to the visual root commits, so they cannot be >> vertically adjacent anymore making it easier to identify them.
[snip]
Show 9 quoted lines
> > Sorry, I know I'm a bit late to the discussion regarding the design, > but, could we maybe have two different code paths for printing graphs? > Having the old one as a default and this new one only when we're using > --oneline (well, --format=reference would benefit too)? As it is now if > I have multiple one-patch series in sequence the entries are > unnecessarily indented. > > Thanks
No worries :)
Well, I thought that it could become annoying given the scenario of having too many visual roots one after the other. But I didn't have a clear way of having that scenario without forcing it.
I think that this solves an ambiguity so it should be the default option and someone who doesn't want the indentation has to explicitly unset it maybe with something like '--no-graph-indent'.
Apart from having an option to disable indentation.
We could have the cascading to have a limit or make it zig-zag:
instead of:
A
B
C
DWe could do:
A B C D
This would have its own edge cases like:
A B C <- if we zig-zag here C and D become ambiguous, currently we are D indenting only the last commits (visual roots) here we would have D to chose between continuing cascading or indenting the first of D.
I'm not so sure if I like the zig-zag solution because we need to think again if it causes an ambiguity, but I wanted to mention it.
I think we need some more opinions about the design.
Thanks, Pablo