Re: [GSoC RFC PATCH 0/1] graph: add indentation for commits preceded by a root
- From
Pablo Sabater <pabloosabaterr@gmail.com>
- Date
- May 19, 2026, 05:59 UTC
- Message-ID
- <CAN5EUNSFBC0+aoW1ceGjEiKWBRjzuzUEUjg8Xys5O9rDsJdkjg@mail.gmail.com>
- In-Reply-To
- <xmqq8q9gb704.fsf@gitster.g>
El mar, 19 may 2026 a las 2:03, Junio C Hamano (<gitster@pobox.com>) escribió:
Show 30 quoted lines
> > Pablo Sabater <pabloosabaterr@gmail.com> writes: > > > By having is_parentless as a flag in 'git_graph' that every stage can > > access we could modify the rendering and maybe completely drop the > > commit placeholders, working on it for v4 but currently renders like > > this > > > > * A parentless > > * B parentless > > * C parentless > > * D1 child > > * D parentless > > > > (A has indentation when it could not have, but that would require a > > lookahead if the next commit is also parentless) > > But definitely a step forward. > > > > Do we want cascading or just a fixed indentation? > > > > * A parentless > > * B parentless > > * C parentless > > * D1 child > > * D parentless > > I am late to the party, but I cannot get how the latter is viable. > If "A" had parent "B" whose parent was "C" that is root, wouldn't we > see the same output? Or are we adding " parentless" at the end of > the one-liner log message?
We wouldn't see the same output because A and B wouldn't get padded in that case. Vertical adjacency between indented commits doesn't imply relation because indentation means that they are "parentless", ambiguity happens when there's no indentation, you can't know whether they are related or not, but knowing that every indented commit is a "parentless" eliminates the ambiguity.
* A child * B child \ * C parentless * D1 child * D parentless
Some different cases:
A child \ B parentless C parentless
A parentless B parentless C parentless
C has no indentation because if there's nothing to render below, indentation is disabled.
A parentless B child C parentless
Anyways, having more than 2 "parentless" commits one after the other is strange. Cascading is just having a depth counter and printing the padding depth times, so I'll keep it as it is more intuitive.
Show 5 quoted lines
> > The former, with the understanding that "two '*' commit marks > vertically adjacent have parent-child relationship, otherwise we > draw line between '*' to connect them if they have parent-child > relationship", does not have such a problem.